Python | Numpy MaskedArray .__ ifloordiv__



numpy.ma.MaskedArray class is a subclass of ndarray for manipulating numeric arrays with missing data. With Numpy MaskedArray .__ ifloordiv__ we can get the gender division of a specific value, which is supplied as a parameter in the MaskedArray method .__ ifloordiv __ ().

Syntax: numpy.MaskedArray .__ ifloordiv __ (other)

Return: Floor divide self by other in-place.

Example # 1:
In this example, we see that each element in the array is divisible by the value specified as a parameter in the MaskedArray method .__ ifloordiv __ ().

# import an important module into python

import numpy as np 

 
# make an array with NumPy

gfg = np.ma.array ([ 10 , 20.5 , 30 , 4.8 , 50 ]) 

 
# applying MaskedArray .__ method ifloordiv __ ()

print (gfg .__ ifloordiv __ ( 2 ) ) 

Exit:

 [5 . 10. 15. 2. 25.] 

Example # 2:

# import important module in python

import numpy as np 

  
# make an array with NumPy

gfg = np.ma.array ([[ 10 , 20 , 30 , 4.45 , 50 ], 

[ 6 , 5.5 , 4 , 3 , 2.62 ]]) 

  

 
# Ma application skedArray .__ method ifloordiv __ ()

print (gfg .__ ifloordiv __ ( 5 )) 

Exit:

 [[2. 4. 6. 0. 10.] [1. 1. 0. 0. 0.]]