[Numpy-discussion] Adding a flag to allow integer array access and masking

Travis Oliphant oliphant at ee.byu.edu
Thu Mar 7 09:11:08 EST 2002


> No, I basically agree, I just don't have that need immediately and
> therefore am less motivated to work on it.
>
> My preferred solution would be to use special objects (in the spirit
> of the slice object) for special indexing methods, rather than special
> cases of existing objects. The advantage is that any number of those
> can be added over time as the need arises, and there is never a risk
> of changing the meaning of existing code.
>


Thanks for the comments you have made.  I always appreciate them.

Are you suggesting something like:

b = IndexArray([1,3,10,100])

a[b]?

This is really not much different than.

a[[1,3,10,100],IndexArray]

which is essentially what I've suggested (I was looking for shortcuts),
but in principle

IndexArray could be a class with a method that the code in Numeric
interfaces with.

> However, I do think that this should be thought out and discussed
> carefully, but unfortunately I won't be able to help much due to lack
> of time.
>

Thanks for participating thus far.

-Travis






More information about the NumPy-Discussion mailing list