<div dir="ltr"><div>The distinction that boolean indexing has over the other 2 methods of indexing is that it can guarantee that it references a position at most once. Slicing and scalar indexes are also this way, hence why these methods allow for in-place assignments. I don't see boolean indexing as an extension of orthogonal indexing because of that.<br><br></div>Ben Root<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 2, 2015 at 2:41 PM, Stephan Hoyer <span dir="ltr"><<a href="mailto:shoyer@gmail.com" target="_blank">shoyer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Thu, Apr 2, 2015 at 11:03 AM, Eric Firing <span dir="ltr"><<a href="mailto:efiring@hawaii.edu" target="_blank">efiring@hawaii.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fancy indexing is a horrible design mistake--a case of cleverness run<br>
amok.  As you can read in the Numpy documentation, it is hard to<br>
explain, hard to understand, hard to remember.</blockquote><div><br></div></span><div>Well put!</div><div><br></div><div>I also failed to correct predict your example.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So I think you should turn the question around and ask, "What is the<br>
actual real-world use case for fancy indexing?"  How often does real<br>
code rely on it?</blockquote><div><br></div></span><div>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 stands.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Stephan</div></font></span></div></div></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div>