The following is a very easy way to see the maximum elements and its positions. Here axis
is the domain; axis
= 0 means column wise maximum number and axis
= 1 means row wise max number for the 2D case. And for higher dimensions it depends upon you.
M = np.random.random((3, 4))
print(M)
print(M.max(axis=1), M.argmax(axis=1))