[Numpy-discussion] Multiarray PEP

Timo Korvola tkorvola at welho.com
Thu Feb 17 06:53:26 CST 2005


Travis Oliphant <oliphant at ee.byu.edu> writes:
> except for the fact that X[K] where K is a a single
> integer index array can do 1-d indexing similar to MATLAB.

I find the current Numarray behaviour more logical.  Is 1-D indexing
really useful enough to require a shorter and less clear notation
than X.flat[K]?

Another one that I don't like is capping the indices.  Is it useful or
just a potential source of obscure errors?  Throwing an IndexError for
out of range indices would seem safer.

Perhaps only one ellipsis should be allowed for clarity?  Is it useful
to allow more if they are only equivalent to colons?

Integers scalars are not on the list where you describe how different
types are interpreted in advanced indexing.  I suppose the intention
is to treat them as rank 0 arrays, broadcastable to any shape.

The rank of a basic index expression can only be zero if all
dimensions are indexed and all the indices are integers.  Are you
really suggesting that a rank 0 array rather than a scalar be returned
in that case?

-- 
	Timo Korvola		<URL:http://www.iki.fi/tkorvola>




More information about the Numpy-discussion mailing list