[Numpy-discussion] Another dumb structured array question

Skipper Seabold jsseabold at gmail.com
Wed Sep 30 11:47:13 EDT 2009


On Wed, Sep 30, 2009 at 11:01 AM, Ralf Gommers
<ralf.gommers at googlemail.com> wrote:
>
>
> On Wed, Sep 30, 2009 at 10:24 AM, Skipper Seabold <jsseabold at gmail.com>
> wrote:
>>
>> On Wed, Sep 30, 2009 at 9:51 AM, Travis Oliphant <oliphant at enthought.com>
>> wrote:
>> >
>> > 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:
> http://docs.scipy.org/numpy/docs/numpy-docs/user/basics.rec.rst/
>

Is the only way to edit these that use the automodule directive to
submit a patch to, say,
<http://svn.scipy.org/svn/numpy/trunk/numpy/doc/structured_arrays.py>?

Skipper



More information about the NumPy-Discussion mailing list