I'm trying to print the index of the smallest number in an array. The array is:
import numpy as np
z = np.array(
[
[2.3, 5.9, 0.01],
[7.7, 2.22, 1.02],
[0.5, 2.7, 9.8],
[3.76, 5.323, 5.24],
]
)
so the smallest value is 0.01. But when I print the index of this:
new = np.argmin(z)
My output is 2 which is only the index for column. However, I also want the index for the row which is 0. Is there an easy way to do this?