Why not use np.nonzero here?