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

Rob Speer rspeer@MIT....
Thu Jul 8 17:03:37 CDT 2010


> 3. That the  best solution to allow integer ticks while retaining
> 'normal' indexing semantics for integers would be to have
>
> arr[int] -> normal indexing
> arr.somethin[int] -> tick-based indexing, where an int can mean anything.

All right, it's clear lots of people like it better this way, so I
made arr.named use square brackets instead of parentheses.

Before:
>>> arr.country.named('Spain').year.named(slice(1994, 2010))
After:
>>> arr.country.named['Spain'].year.named[1994:2010]

-- Rob


More information about the NumPy-Discussion mailing list