I would like to find the indices of the value 9. In this case, that is 0, 1, 0.
In Numpy, I would stack that array with a 2x2x2 meshgrid, giving the row and column of each element. Then, if I find the maximum element in arr[:,:,0], I just need to look at arr[:,:,1::] to get the row and column indices.
Hi there,
How can I find the INDICES of the max value in an array?
E.g., if my array looks like this:
I would like to find the indices of the value 9. In this case, that is
0, 1, 0
.In Numpy, I would stack that array with a 2x2x2 meshgrid, giving the row and column of each element. Then, if I find the maximum element in arr[:,:,0], I just need to look at arr[:,:,1::] to get the row and column indices.
Thanks Jack