On 6/17/06, Francesc Altet <[EMAIL PROTECTED]> wrote: > However, I think that this has its utility, specially when accessing to > nested fields (see later). In addition, I'd suggest introducing a > special accessor called, say, 'fields' in order to access the fields > themselves and not the attributes. For example, if you want to access > the 'strides' attribute, you can do it in the usual way: > > >>> import numpy > >>> tr=numpy.recarray(10, formats='i4,f8,f8', names='id,ra,strides') > >>> tr.strides > (20,) > > but, if you want to access *field* 'strides' you could do it by issuing: > > >>> tr.fields.strides > <repr of field accessor object (shape, type...)> > >>> tr.fields.strides[:] > array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
[...] +1 I meant to write exactly the same thing, but was too lazy to do it :) Cheers, f _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion