Python | Numpy matrix.min ()

NumPy | Python Methods and Functions

Using the Numpy matrix.min () method, we can get the minimum value from a given matrix.

Syntax: matrix.min()

Return: Return minimum value from a given matrix

Example # 1:
In this example, we see that we can get the minimum value from a given matrix using the matrix method .min () .

# import important module into python

import numpy as np

  
# make a matrix with NumPy

gfg = np.matrix ( `[64, 1; 12, 3]` )

 
# applying the method matrix.min ()

geeks = gfg. min ()

 

print (geeks)

Exit :

 1 

Example # 2:

# import 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] ` )

  
# using the matrix.min () method

geeks = gfg. min ()

 

print (geeks)

Exit:

 -9 




Get Solution for free from DataCamp guru