From: Oleksandr H. <guz...@gm...> - 2013-08-28 00:45:06
|
2013/8/27 Anthony Scopatz <sc...@gm...> > > You are right that this loads the entire computed array into memory and is > therefore not optimal. I would do something like the following: > > h = tb.open_file(path, mode="a") > varTable = h.get_node("/", var_name) > coef = 3 * 60 * 60 #output step > c = varTable.cols.field > expr = tb.Expr("c * m", uservars = {"c": c, "m": coef }) > expr.set_output(c) > expr.eval() > varTable.flush() > h.close() > Aha, this is cool. Thanks Anthony. Cheers -- Sasha > >>> On Tue, Aug 27, 2013 at 11:44 AM, Oleksandr Huziy < >>> guz...@gm...> wrote: >>> >>>> Hi All: >>>> >>>> I have a huge table imported from other binary files to hdf, and I >>>> forgot to multiply the data by a factor in one case. Is there an easy way >>>> to multiply a column by a constant factor using pytables? >>>> To modify it in place? >>>> >>>> Thank you >>>> >>>> -- >>>> Sasha >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>>> Discover the easy way to master current and previous Microsoft >>>> technologies >>>> and advance your career. Get an incredible 1,500+ hours of step-by-step >>>> tutorial videos with LearnDevNow. Subscribe today and save! >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Pytables-users mailing list >>>> Pyt...@li... >>>> https://lists.sourceforge.net/lists/listinfo/pytables-users >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >>> Discover the easy way to master current and previous Microsoft >>> technologies >>> and advance your career. Get an incredible 1,500+ hours of step-by-step >>> tutorial videos with LearnDevNow. Subscribe today and save! >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Pytables-users mailing list >>> Pyt...@li... >>> https://lists.sourceforge.net/lists/listinfo/pytables-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! >> Discover the easy way to master current and previous Microsoft >> technologies >> and advance your career. Get an incredible 1,500+ hours of step-by-step >> tutorial videos with LearnDevNow. Subscribe today and save! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk >> _______________________________________________ >> Pytables-users mailing list >> Pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/pytables-users >> >> > > > ------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk > _______________________________________________ > Pytables-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pytables-users > > |