On Sat, Apr 12, 2014 at 4:47 PM, Alan G Isaac <alan.is...@gmail.com> wrote:

> As a simple example, suppose for array `a` I want
> np.flatnonzero(a>0) and np.flatnonzero(a<=0).
> Can I get them both in one go?
>

I don't think you can do better than

x = a > 0
p, q = np.flatnonzero(x), np.flatnonzero(~x)
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to