Given an array A of shape m x n x n
(i.e., a stack of square matrices),
I want an n x n array that gives the
minimum "depth" to a nonzero element.
E.g., the 0,0 element of the result is
np.flatnonzero(A[:,0,0])[0]
Can this be vectorized?
(Assuming a nonzero element exists is ok,
but dealing nicely with its absence is even better.)

Thanks,
Alan Isaac
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to