Python | Numpy matrix.argmin()
Last Updated :
10 Apr, 2019
With the help of Numpy matrix.argmax()
method, we are able to find the index value of the minimum element in the given matrix having one or more dimension.
Syntax : matrix.argmin()
Return : Return index number of minimum elements in matrix
Example #1 :
In this example we can see that with the help of matrix.argmax()
method we are able to find the index of minimum element in a given matrix.
import numpy as np
gfg = np.matrix( '[1, 2, 3, 4]' )
geeks = gfg.argmin()
print (geeks)
|
Example #2 :
import numpy as np
gfg = np.matrix( '[1, 2, 3; 4, -5, 6; 7, 8, 9]' )
geeks = gfg.argmin()
print (geeks)
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...