So if I have a matrix like this:
[ 6 9 4 7]
[ 1 2 3 4]
[ 3 5 9 8]
[ 5 7 2 4]
I want to know how many times the first column is the minimum. For example, here the answer would be 2
, where the 2nd and 3rd row have column 1 as the minimum. I know we can find the minimum using matrix.min(axis=1)
from this, and I think we can use numpy.sum
to count the number of rows... but how would I actually know from which column the minimum came from? I there some simple way to accomplish this in numpy?