I have an array as such:
array([[ 10, -1],
[ 3, 1],
[ 5, -1],
[ 7, 1]])
I want to get the index of the row with the smallest value in the first column and -1 in the second.
Basically, np.argmin()with the condition that the second column be -1 (or any other value in this regard).
In my example, I would like to get 2which is an index [ 5, -1].
I am sure there is an easy way, but I cannot find it.
source
share