Python | Numpy np.ma.mini () method

Using the np.ma.mini() method, we can get the minimum value of the masked array using np.ma.mini () .

Syntax: np.ma.mini ()
Return: Return the minimum value of masked array.

Example # 1:
In this example we can see that with np.ma.mini () we can get the minimum value of the masked array using this method.

# NumPy import

import numpy as np

import numpy.ma as ma

 
# using the np method. ma.mini ()

gfg = ma.array (np.arange ( 6 ) , mask = [ - 2 , - 1 , 0 , 1 , 2 , 3 ]). reshape ( 3 , 2 )

min = gfg.mini ()

 

print ( min )  

Output:

2

Example # 2:

# NumPy import

import numpy as np

import numpy.ma as ma

 
# using the np.ma.mini () method

gfg = ma.array (np.arange ( 10 ), mask = [ - 2 , - 1 , 0 , 1 , 0 , 3 , 0 , 0 , 0 , 0 ] ) .reshape ( 2 , 5 )

min = gfg.mini ()

 

print ( min )

Output:

2





Get Solution for free from DataCamp guru