fork(1) download
  1. import numpy as np
  2.  
  3. a = np.array(
  4. [[1, 2],
  5. [3, 4],
  6. [2, 5]])
  7.  
  8. v = np.array([2, 5, 2]).reshape(-1, 1)
  9.  
  10. print(np.logical_or.reduce(a == v, axis=1))
Success #stdin #stdout 0.11s 24432KB
stdin
Standard input is empty
stdout
[ True False  True]