From: Francesc A. <fa...@ca...> - 2005-04-26 08:50:46
|
Hi Dragan, I see. Well, the sort answer is no: PyTables does not support multidimensional arrays of tables. HDF5 does support this as well as numarray. We can start thinking in implementing such a support sometime after PyTables 1.0 release. However, depending on what you are trying to do, you may want to check VLArrays of objects. You can create a numarray.RecArray object for each simulation run and save it as an entry in a VLArray. Regards, A Dilluns 25 Abril 2005 13:12, v=E0reu escriure: > Hello Francesc, > > I think I was not clear enough. My question was > related to having an multidimensional array of tables. > Each element of the array would therefore present one > table with data of one simulation run. > Does this make any sence to you? > > Thanks for replying. > > Greetings, Dragan. > > --- Francesc Altet <fa...@ca...> wrote: > > Hello Dragan, > > > > On Sunday 24 April 2005 17:59, dragan savic wrote: > > > A table is typically the result of a simulation > > > > run. > > > > > When more runs are done, each run has normally > > > different values for one of parameters. In my case > > > > I > > > > > have for example three parameters: switch size, > > > > buffer > > > > > size and load. I would like to have tables as > > > > elements > > > > > of an N dimensional array, where each parameter > > > represents a different dimension, and the number > > > > of > > > > > possible values of that parameter is the size of > > > > the > > > > > array along that dimension. Each dimension should > > > have a scalar or a string type. > > > Is this possible to achieve with Pytables? > > > > Well, if I have not misunderstood you, yes, I think > > you can achieve > > this goal using PyTables. Just declare the next > > description > > dictionary: > > > > tsim=3D{'switch_size': > > UInt16Col(shape=3Dmax_size_switch), > > 'buffer_size': > > UInt32Col(shape=3Dmax_buffer_switch), > > 'load': UInt8Col(shape=3Dmax_size_load), > > } > > > > Then, create the table with compression enabled: > > > > table =3D fileh.createTable(group, 'table', tsim, "A > > table", Filters(1)) > > > > Please, take in account that, as you use compression > > (see the > > Filters(1) parameter), you don't waste too much > > space by booking > > columns with maximum possible sizes. > > > > If you want true variable length records, even with > > compression > > support (but not able to deal with heterogeneous > > data), you can use a > > combination of three VLArray objects (one per each > > parameter). See > > http://pytables.sourceforge.net/html/tut/vlarray2.html > > > for an example > > of use. > > > > HTH, > > > > Francesc Altet > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |