18 Dec
2017
18 Dec
'17
12:23 p.m.
Use “np.all” or “np.any”. On 18 Dec 2017, 10:02 PM +1100, hanno_lists@gmx.net, wrote:
Hi,
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, Hanno