Python | Numpy np.ma.common_fill_value() method Last Updated : 03 Nov, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of np.ma.common_fill_value() method, we can get the common filling values from both the masked array if same by using np.ma.common_fill_value() method. Syntax : np.ma.common_fill_value(array1, array2) Return : Return the common filling value from both the arrays. Example #1 : In this example by using np.ma.common_fill_value() method, we are able to get the common filling values from both the masked arrays. Python3 1=1 # import numpy import numpy as np x = np.ma.array([1, 2, 3], fill_value = 1) y = np.ma.array([7, 8, 9], fill_value = 1) # using np.ma.common_fill_value() method gfg = np.ma.common_fill_value(x, y) print(gfg) Output : 1 Example #2 : Python3 1=1 # import numpy import numpy as np x = np.ma.array([[1, 2], [2, 1]], fill_value = 2) y = np.ma.array([[1, 5], [5, 1]], fill_value = 5) # using np.ma.common_fill_value() method gfg = np.ma.common_fill_value(x, y) print(gfg) Output : None Comment More infoAdvertise with us Next Article Numpy np.ma.concatenate() method-Python J jitender_1998 Follow Improve Article Tags : Technical Scripter Python Python-numpy Python numpy-arrayManipulation Practice Tags : python Similar Reads Numpy MaskedArray.common_fill_value() function | Python numpy.MaskedArray.common_fill_value() function is used to return the common filling value between two masked arrays.If arr1.fill_value == arr2.fill_value then it returns the fill value, otherwise return None. Syntax : numpy.ma.common_fill_value(arr1, arr2) Parameters: arr1, arr2 :[ MaskedArray ] The 3 min read Numpy np.ma.concatenate() method-Python np.ma.concatenate() method joins two or more masked arrays along an existing axis. It works similarly to np.concatenate() but it is specifically designed for masked arrays which may contain missing or invalid data that is "masked" i.e marked to be ignored in computations. Example:Pythonimport numpy 2 min read numpy.ma.masked_values() function | Python numpy.ma.masked_values() function return a MaskedArray, masked where the data in array arr are approximately equal to value, determined using isclose. The default tolerances for masked_values are the same as those for isclose. Syntax : numpy.ma.masked_values(arr, value, rtol = 1e-05, atol = 1e-08, c 2 min read Python | numpy.fill_diagonal() method With the help of numpy.fill_diagonal() method, we can get filled the diagonals of numpy array with the value passed as the parameter in numpy.fill_diagonal() method. Syntax : numpy.fill_diagonal(array, value) Return : Return the filled value in the diagonal of an array. Example #1 : In this example 1 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.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 Like