Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. truth_arr = array([[ True, False, False, True],
  2. [False, True, False, False],
  3. [False, False, True, True],
  4. [False, False, False, True]])
  5.  
  6. [(0, 0), (0, 3), (2, 2), (2, 3)]
  7.  
  8. np.nonzero(truth_arr * truth_arr.sum(axis=1, keepdims=True)>1)
  9. # (array([0, 0, 2, 2]), array([0, 3, 2, 3]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement