Anthony Foglia <AFoglia <at> princeton.com> writes:
> >>    Is there a way to get a Description from a numpy dtype?
> http://www.pytables.org/trac/ticket/263

Maybe you don't need to. This recent enhancement allows you to use a dtype as a 
description:
http://www.pytables.org/trac/browser/trunk/tables/file.py?rev=4230

633             `description`
634                 This is an object that describes the table, i.e. how many
635                 columns it has, their names, types, shapes, etc.  It can be
636                 any of the following:

650                 A NumPy dtype
651                     A completely general structured NumPy dtype is accepted
652                     too, and its field structure will be reflected in the
653                     new `Table` object.

Bonus tip: The easiest way I've found to turn a dtype into something which is 
easier to modify (combine, prune, ...), is 
eval(str(x.dtype))
which returns a list of tuples. ndarray.view() and friends are a bit picky and 
won't accept, say, a list of lists.

Best regards,
Jon Olav



------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to