LoginSignup
0
0

More than 5 years have passed since last update.

numpy.any

Posted at
Z = np.random.randint(0,3,(3,10))
print(Z)
Z = Z.any(axis=0)
print(Z)
print((~Z).any())
  • e.g.
[[0 1 2 0 0 2 0 0 0 0]
 [1 1 1 1 0 0 2 0 1 0]
 [2 1 0 2 2 0 1 2 1 0]]
[ True  True  True  True  True  True  True  True  True False]
True
[[0 0 2 0 0 1 1 0 2 0]
 [2 1 0 1 2 0 1 2 0 2]
 [2 2 1 0 0 1 2 0 1 0]]
[ True  True  True  True  True  True  True  True  True  True]
False

Refs.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0