From: Francesc A. <fa...@op...> - 2003-07-15 17:30:59
|
A Dimarts 15 Juliol 2003 17:50, vareu escriure: > > Limitations: > > 1)you cannot put dictionaries inside of lists, just like you do not put > trees inside of a leaf. That can be a first approximation, but in the future, you might even be able to do that if you create a group for each dictionary of the list (the name for each group can be "some character + str(list position)"), and adding a user defined attribute on the parent group telling what kind of python object represents the info contained on its childs (in that case, a list). > 2)The rows need to have the same type of data. Yeah, and I this is were you can have a lot of work by doing checkings, not only of that of the type, but also preventing the user to provide irregular lists (e.g. ((1,(2,3)),(1,2)) or a lot more of "irregular" situation that I can't think of right now. One approach can be to transform first the user supplied objects into numarray objects (NumArray, RecArray or CharArray) before to pass the object to pytables. numarray will do the job of doing the checks for input correctness, and if they pass (i.e. a numarray object can be created), then the object can be safely passed to pytables. That way, you don't have to reinvent the wheel and take advantage of all the checkings that the numarray library provides to you. Just some thoughts, -- Francesc Alted |