A Saturday 04 October 2008, Mico Filós escrigué: > Hi, > > I am trying to use pytables to store simulated data. The data > organizes quite stereotypically: > > 1. I have a set of parameters, say A, B, and C, which take different > values, e.g, > > A = {a1, a2, a3}, B = {b1, b2}, and C = {c1, c2, c3, > c4} > > 2. For each combination of values for A, B, and C, I have a > collection of datasets corresponding > to different "observations" of the same process: > > {A = a1, B = b1, C = c1: observation1, observation2, > ...}, {A = a2, B = b1, C = c1: observation1, observation2, ...}, > etc. > > 3. Each 'observation' consists of a table, whose fields are 'time' > and x1, x2, x3 ... (the different variables of the system). > The number of rows of this table is not necessarily the same for > all observations. > > I have read the documentation, but I cannot figure out the best way > to organize these data. > A first, naïve guess would be a table like this > > A B C data > --------------------------- > a1 b1 c1 Table1 > a2 b1 c1 Table2, etc > > where each *entry* in the field 'data' consists, in turn, of another > table, with fields > > ntrial trajectory > --------------------- > 1 traj_array1 > 2 traj_array2, etc. > > Each entry in the the field 'trajectory' is an array (or, perhaps, > another table). > But I am not sure if this can be done. > > I would truly appreciate any help on this.
You can only include variable-length objects in the VLArray object. With this, my advice is to save the parameters (fixed-length records) in a Table object and the observations (variable-length records) in a VLArray. For the latter you can use a multidimensional regular Atom in case your observations have an homogeneous type. In case of observations with a heterogeneous type, you may use an ObjectAtom (although pickle/unpickle will be used under the hood). Hope that helps, -- Francesc Alted Freelance developer Tel +34-964-282-249 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Pytables-users mailing list Pytables-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pytables-users