A Dijous 19 Gener 2006 17:12, Stefan Kuzminski va escriure: > I am trying to concatenate a number of NestedRecArrays, however the > numarray concatenate method is trying to pass in a shape parameter, > which NestedRecArray does not have in it's __init__, so I get this.. > > return _concat(arrs) > File > "/work/deva/aif/lib/python2.4/site-packages/numarray/generic.py", line > \ > 1095, in _concat > dest = arrs[0].__class__(shape=destShape) > TypeError: __init__() got an unexpected keyword argument 'shape' > > I tried to convert the NestedRecArray to just a plain old numarray, > with 'array()' but the 'array()' it clever enough to just return the > passed object ( since NestedRecArray extends RecArray ). Any ideas how > I can convert a NestedRecArray to just a plain old number array? I > have all numeric data in this case.
Yes, this is not a thing that have checked out when we implemented the NestedRecArray class. Anyway, you can always get the underlying RecArray object in the "_flatArray" attribute of a NestedRecArray. BTW, I'm working on implementing a flavor for Table objects, so that you can choose the format of the container that you want to use in order to read the table slices. I'll try to add a flavor to distinguish between NestedRecArray and RecArray. Perhaps the best would be to detect if the Table is going to have nested records and if not, then the default would be to return RecArrays instead of NestedRecArrays. Do you have a preference to that matter?. Cheers, -- >0,0< Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data "-" ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Pytables-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/pytables-users
