<div dir="ltr">This is good stuff, but I can't help thinking that if I needed to do an any/all test on a number of arrays with common and/or combos -- I'd probably write a Cython function to do it.<div><br></div><div>

It could be a bit tricky to make it really general, but not bad for a couple specific dtypes / use cases.</div><div><br></div><div>-just a thought...</div><div><br></div><div style>Also -- how does this work with numexpr? It would be nice if it could handle these kinds of cases.</div>

<div><br></div><div>-Chris</div><div><br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 5, 2013 at 1:54 AM, Graeme B. Bell <span dir="ltr"><<a href="mailto:grb@skogoglandskap.no" target="_blank">grb@skogoglandskap.no</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Hi Julian,<br>
<br>
Thanks for the post.  It's great to hear that the main numpy function is improving in 1.8, though I think there is still plenty of value here for performance junkies :-)<br>
<br>
I don't have 1.8beta installed (and I can't conveniently install it on my machines just now). If you have time, and have the beta installed, could you try this and mail me the output from the benchmark?  I'm curious to know.<br>


<br>
# git clone <a href="https://github.com/gbb/numpy-fast-any-all.git" target="_blank">https://github.com/gbb/numpy-fast-any-all.git</a><br>
# cd numpy-fast-any-all<br>
# python test-fast-any-all.py<br>
<br>
Graeme<br>
<br>
<br>
On Sep 4, 2013, at 7:38 PM, Julian Taylor <<a href="mailto:jtaylor.debian@googlemail.com">jtaylor.debian@googlemail.com</a>> wrote:<br>
<br>
>><br>
>> The result is 14 to 17x faster than np.any() for this use case.*<br>
><br>
> any/all and boolean operations have been significantly speed up by<br>
> vectorization in numpy 1.8 [0].<br>
> They are now around 10 times faster than before, especially if the<br>
> boolean array fits into one of the cpu caching layers.<br>
<div class="HOEnZb"><div class="h5"><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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>

Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a>
</div>