Wednesday, May 6, 2026
HomeLanguagesPython | Numpy matrix.argmin()

Python | Numpy matrix.argmin()

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 the important module in python
import numpy as np
           
# make a matrix with numpy
gfg = np.matrix('[1, 2, 3, 4]')
           
# applying matrix.argmin() method
neveropen = gfg.argmin()
     
print(neveropen)


Output:

0

Example #2 :




# import the important module in python
import numpy as np
           
# make a matrix with numpy
gfg = np.matrix('[1, 2, 3; 4, -5, 6; 7, 8, 9]')
           
# applying matrix.argmin() method
neveropen = gfg.argmin()
     
print(neveropen)


Output:

4
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32514 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6889 POSTS0 COMMENTS
Nicole Veronica
12011 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12105 POSTS0 COMMENTS
Shaida Kate Naidoo
7016 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6975 POSTS0 COMMENTS
Umr Jansen
6962 POSTS0 COMMENTS