[Numpy-discussion] Applying logical operations along an axis of a boolean array?
jni.soma at gmail.com
Mon Dec 18 06:23:51 EST 2017
Use “np.all” or “np.any”.
On 18 Dec 2017, 10:02 PM +1100, hanno_lists at gmx.net, wrote:
> is it possible, to apply a logical operation, such as AND or OR along a particular axis of a numpy array?
> Let's say I have an (n,m) array and I want to AND along the first axis, such that I get a (1,m) (or just (m,) dimensional array back. I looked at the documentation for np.logical_and and friends but couldn't find an axis keyword on the logical_xyz operations and nothing else seemed to fit.
> Thanks, and best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion