python | Numpy masked_equal() method Last Updated : 19 Sep, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of numpy.ma.masked_equal() method, we can get the mask a value that in an array by using numpy.ma.masked_equal() method. Syntax : numpy.ma.masked_equal(array, value) Return : Return the array after removing mask value. Example #1 : In this example we can see that by using numpy.ma.masked_equal() method, we are able to get the new array after removing mask value which is passed along with an array. Python3 1=1 # import numpy import numpy.ma as ma # using numpy.ma.masked_equal() method gfg = ma.masked_equal([1, 2, 3, 4], 3) print(gfg) Output : [1 2 -- 4] Example #2 : Python3 1=1 # import numpy import numpy.ma as ma # using numpy.ma.masked_equal() method gfg = ma.masked_equal([[1, 2, 3, 4], [6, 7, 8, 9]], 6) print(gfg) Output : [[1 2 3 4] [-- 7 8 9]] Comment More infoAdvertise with us Next Article Numpy MaskedArray.filled() method - Python J jitender_1998 Follow Improve Article Tags : Python Python-numpy Practice Tags : python Similar Reads Python | Numpy getmask() method With the help of numpy.getmask() method, we can get the masked matrix of numpy array which shows masked values by using numpy.getmask() method. Syntax : numpy.getmask(array) Return : Return masked values of a matrix. Example #1 : In this example we can see that by using numpy.getmask() method, we ar 1 min read Numpy MaskedArray.filled() method - Python numpy.MaskedArray.filled() function return a copy of self, with masked values filled with a given value. However, if there are no masked values to fill, self will be returned instead as an ndarray. Syntax : numpy.MaskedArray.filled(self, fill_value = None) Parameters : fill_value : [scalar, optional 2 min read Python | numpy.ma.ids() method With the help of numpy.ma.ids() method, we can get the address of masked array having data by using numpy.ma.ids() method. Syntax : numpy.ma.ids(array, mask) Return : Return the address of masked array. Example #1 : In this example we can see that by using numpy.ma.ids() method, we are able to get t 1 min read Numpy MaskedArray asarray() method | Python numpy.ma.asarray() function is used when we want to convert input to a masked array of the given data-type. No copy is performed if the input is already a ndarray. If arr is a subclass of MaskedArray, a base class MaskedArray is returned. Syntax : numpy.ma.asarray(arr, dtype=None, order=None) Parame 2 min read Python | Numpy getmaskarray() method With the help of numpy.getmaskarray() method, we can get the masked matrix in the form numpy array which shows masked values by using numpy.getmaskarray() method. Syntax : numpy.getmaskarray(array) Return : Return masked values in the form of numpy array. Example #1 : In this example we can see that 1 min read Python | Numpy MaskedArray.__mod__ What is a mask? A boolean array, used to select only certain elements for an operation Python3 # A mask example import numpy as np x = np.arange(5) print(x) mask = (x > 2) print(mask) x[mask] = -1 print(x) Output: [0 1 2 3 4] [False False False True True] [ 0 1 2 -1 -1] numpy.ma.MaskedArray class 2 min read Like