numpy.ma.MaskedArray class is a subclass of ndarray for manipulating numeric arrays with missing data. Using Numpy MaskedArray .__ imod__ we can get that each element in the array is operated with a binary operator, i.e. mod (%). Remember that we can use any type of value in the array, and the value for mod is applied as a parameter in the MaskedArray method .__ imod __ ().
Syntax: numpy .MaskedArray .__ imod __ (other)
Return: Return self% = value.
Example # 1: strong >
In this example, we can see that the value we passed through the MaskedArray method .__ imod __ () is used to perform a mod operation on each element of the array.
[1.0 0.5 1.0 1.0 1.0]
Example # 2: strong>