I have a numpy array (a list of 2 elements lists) a give below and I have a list of 2 elements [30.94, 0.] that I would like to look for.
When I did the following I don't get the desired result. Why?
import numpy as np
a = np.array([[ 5.73, 0. ],
[ 57.73, 10. ],
[ 57.73, 20. ],
[ 30.94, 0. ],
[ 30.94, 10. ],
[ 30.94, 20. ],
[ 4.14, 0. ],
[ 4.14, 10. ]])
np.where(a==np.array([30.94, 0.]))
But I get
(array([0, 3, 3, 4, 5, 6]), array([1, 0, 1, 0, 0, 1]))
which is not true.
a==np.array([30.94, 0.]?[3, 3]for the indices of the rows and[0, 1]for the indices of the columns or something like this.np.where, just :a==np.array([30.94, 0.]. My idea is if you look at its output, you would have a better picture, hopefully.[0, 0, 0, 1, 0, 0, 0, 0]?