[Numpy-discussion] Another dumb structured array question
Wed Sep 30 10:01:34 CDT 2009
On Wed, Sep 30, 2009 at 10:24 AM, Skipper Seabold <firstname.lastname@example.org>wrote:
> On Wed, Sep 30, 2009 at 9:51 AM, Travis Oliphant <email@example.com>
> > On Sep 29, 2009, at 3:32 PM, David Warde-Farley wrote:
> >> Is there an easy way to get multiple subdtypes out? e.g. if I have a
> >> dtype
> >> dtype([('foo', 'i4'), ('bar', 'i8'), ('baz', 'S100')])
> >> and an array with that dtype, is there a way to only get the 'foo' and
> >> 'bar'?
> >> arr[('foo','bar')] doesn't seem to work.
> > Try (with a later version of NumPy --- possibly trunk):
> > arr[['foo', 'bar']]
> > (i.e. with a list instead of a tuple)
> That's really helpful to know. Is it too early to document this on
> the wiki <http://docs.scipy.org/doc/numpy/user/basics.rec.html>?
Not at all. If it works in trunk it can be documented here:
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion