Numpy Array Get row index searching by a row Numpy Array Get row index searching by a row python python

Numpy Array Get row index searching by a row


Why not simply do something like this?

>>> aarray([[ 0.,  5.,  2.],       [ 0.,  0.,  3.],       [ 0.,  0.,  0.]])>>> barray([ 0.,  0.,  3.])>>> a==barray([[ True, False, False],       [ True,  True,  True],       [ True,  True, False]], dtype=bool)>>> np.all(a==b,axis=1)array([False,  True, False], dtype=bool)>>> np.where(np.all(a==b,axis=1))(array([1]),)