A Monday 25 October 2010 19:47:30 Curiouslearn escrigué: > Hi, > > I am very new to Pytables. I was trying out the commands in the > tutorial and learnt that to create a new table I need to describe > columns as class variables. For example, > > import pytables > > def tableFormat(tables.IsDescription): > column1Name = tables.StringCol(16) > column2Name = tables.StringCol(16) > column3Name = tables.StringCol(16) > > This is fine if I have only a few columns. What if I have 100 columns > (each column being a run from a simulation) and I want to name them > PriceVector1, PriceVector2, ..., PriceVector100. > > Is there a way to create table without typing out name of each of the > 100 columns?
Yes, many. See the `description` docstring of `File.createTable` for all possible ways to pass table descriptions: http://www.pytables.org/docs/manual/ch04.html#createTableDescr Hope this helps, -- Francesc Alted ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Pytables-users mailing list Pytables-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pytables-users