I have a bi-dimensional np.array like
x = np.array([[1,2], [4,5], [4,6], [5,4], [4,5]])
now I want the indices where x is equal to [4,5] (-> [1, 4]). The operator == works in a different way:
x == [4,5]
array([[False, False],
[ True, True],
[ True, False],
[False, False],
[ True, True]], dtype=bool)
but I want something like [False, True, False, False, True]. Is it ok to do an and?
Usually the array is very big and I have to do it a lot of times, so I need a very fast way.
this should be the numpy-way: