[Numpy-discussion] recarray field names

John Parejko parejkoj at drexel.edu
Mon Jul 10 12:46:45 EDT 2006


Howdy!  I just wanted to voice my agreement with this statment by Erin Sheldon:

 > I brought up the issue a while back of having a simple way to
 > access the field names of an array. The quick summary: accessing
 > field names has some oddness that needs cleaning up.

Sometimes a['name'], sometimes a.field('name').  I vastly prefer the first 
version; it has become my favored way of dealing with my FITS and ASCII 
data.  But using the bracket notation sometimes gives an error, and I 
haven't quite figured out what the circumstances are.

Also, "for name in a.dtype.fields:" or "for name in a.fields:" would be 
very, very handy.

Could this sort of thing get put in before the beta (or is it already in, 
and I missed the boat, again?).

Thanks
John

-- 
*************************
John Parejko
Department of Physics and Astronomy
215 895-2786
Drexel University
Philadelphia, PA
**************************




More information about the NumPy-Discussion mailing list