[Numpy-discussion] Advanced indexing: "fancy" vs. orthogonal

Stephan Hoyer shoyer at gmail.com
Thu Apr 2 14:41:59 EDT 2015

On Thu, Apr 2, 2015 at 11:03 AM, Eric Firing <efiring at hawaii.edu> wrote:

> Fancy indexing is a horrible design mistake--a case of cleverness run
> amok.  As you can read in the Numpy documentation, it is hard to
> explain, hard to understand, hard to remember.

Well put!

I also failed to correct predict your example.

> So I think you should turn the question around and ask, "What is the
> actual real-world use case for fancy indexing?"  How often does real
> code rely on it?

I'll just note that Indexing with a boolean array with the same shape as
the array (e.g., x[x < 0] when x has greater than 1 dimension) technically
falls outside a strict interpretation of orthogonal indexing. But there's
not any ambiguity in adding that as an extension to orthogonal indexing
(which otherwise does not allow ndim > 1), so I think your point still

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150402/03049ee9/attachment.html>

More information about the NumPy-Discussion mailing list