Why not simply do something like this?
>>> a
array([[ 0., 5., 2.],
[ 0., 0., 3.],
[ 0., 0., 0.]])
>>> b
array([ 0., 0., 3.])
>>> a==b
array([[ 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]),)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…