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

Fernando Perez fperez.net@gmail....
Thu Jul 8 15:20:59 CDT 2010

On Thu, Jul 8, 2010 at 1:15 PM, Lluís <xscript@gmx.net> wrote:
>> My impression from SciPy was that people would prefer separate
>> accessors for names and indices, especially because integers (a really
>> common data type, after all) shouldn't be forbidden. Also, working
>> with strings of integers like '2010' makes me feel like I'm using PHP,
>> a feeling I like to avoid whenever possible. :)
> This boils down to one single question: must it be allowed to index with a mix
> of names (whatever their type) _and_ "good-old" integer indexes that are not
> "translated"?

The consensus at the  BoF (not that it means it's set in stone, simply
that there was  good chance for back-and-forth on the topic with many
voices) was that:

1. There are valid use cases for 'integer ticks',  i.e. integers that
index arbitrarily into an  array instead of in 0..N-1 fashion.

2. That having plain arr[0] give anything but the first element in arr
would be way too confusing in practice, and likely to cause too many

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.



More information about the NumPy-Discussion mailing list