[Numpy-discussion] BOF notes: Fernando's proposal: NumPy ndarray with named axes

Christopher Barker Chris.Barker@noaa....
Fri Jul 9 18:05:39 CDT 2010


Hi folks,

There has been a lot of great discussion about this -- and I"m really 
glad to see it happening -- I've been putting off refactoring my own 
lame, limited, poorly designed, special purpose version of this for ages.

One question I have (that may have been answered) is about slicing:

I think there has been mention of slicing dataarrays according to names 
(would that be tick names?), but I'm not sure how that would work. There 
are two orders:

   The order that the data is in the array. i.e. the regular index order

   The order you would get by sorting the ticks (assuming that the tick 
names are sortable -- datetimes, numbers, strings, etc)

So what would you get if you wanted:

MyDataArray['jones':'wilson']

or

MyDataArray.names[slice('jones','wilson')]

or whatever the syntax would be?


If it was in alphabetical order, you'd be all set, but what it if 
wasn't? It would be pretty cool if you could get an alphabetical slice.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov


More information about the NumPy-Discussion mailing list