Re: [Numpy-discussion] Another dumb structured array question

2009-09-30 Thread David Warde-Farley
On 30-Sep-09, at 9:51 AM, Travis Oliphant wrote: > Try (with a later version of NumPy --- possibly trunk): > > arr[['foo', 'bar']] > > (i.e. with a list instead of a tuple) Aha! Thanks Travis. I guess tuples for multi-dimensional indexing _and_ multi-field indexing would be semantically awkw

Re: [Numpy-discussion] Another dumb structured array question

2009-09-30 Thread Skipper Seabold
On Wed, Sep 30, 2009 at 12:00 PM, Ralf Gommers wrote: > No, all the docs should be in the wiki. The page corresponding to the link > you gave is http://docs.scipy.org/numpy/docs/numpy.doc.structured_arrays/ > > And if you use "diff to svn" on that page you can see that it already > contains improv

Re: [Numpy-discussion] Another dumb structured array question

2009-09-30 Thread Ralf Gommers
On Wed, Sep 30, 2009 at 11:47 AM, Skipper Seabold wrote: > On Wed, Sep 30, 2009 at 11:01 AM, Ralf Gommers > wrote: > >> That's really helpful to know. Is it too early to document this on > >> the wiki ? > > > > Not at all. If it works in trun

Re: [Numpy-discussion] Another dumb structured array question

2009-09-30 Thread Skipper Seabold
On Wed, Sep 30, 2009 at 11:01 AM, Ralf Gommers wrote: > > > On Wed, Sep 30, 2009 at 10:24 AM, Skipper Seabold > wrote: >> >> On Wed, Sep 30, 2009 at 9:51 AM, Travis Oliphant >> wrote: >> > >> > On Sep 29, 2009, at 3:32 PM, David Warde-Farley wrote: >> > >> >> Is there an easy way to get multiple

Re: [Numpy-discussion] Another dumb structured array question

2009-09-30 Thread Ralf Gommers
On Wed, Sep 30, 2009 at 10:24 AM, Skipper Seabold wrote: > On Wed, Sep 30, 2009 at 9:51 AM, Travis Oliphant > 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

Re: [Numpy-discussion] Another dumb structured array question

2009-09-30 Thread Skipper Seabold
On Wed, Sep 30, 2009 at 9:51 AM, Travis Oliphant 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

Re: [Numpy-discussion] Another dumb structured array question

2009-09-30 Thread Travis Oliphant
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'

Re: [Numpy-discussion] Another dumb structured array question

2009-09-29 Thread Robert Kern
On Tue, Sep 29, 2009 at 15:32, 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

[Numpy-discussion] Another dumb structured array question

2009-09-29 Thread David Warde-Farley
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. David