Skip to content

Tag Archives: Python Numpy-Masked Array

numpy.ma.allclose() function returns True if two arrays are element-wise equal within a tolerance. This function is equivalent to allclose except that masked values are treated… Read More
numpy.ma.MaskedArray.toflex() function transforms a masked array into a flexible-type array. The flexible type array that is returned will have two fields: the _data field and… Read More
numpy.ma.where() function return a masked array with elements from x or y, depending on condition. Syntax : numpy.ma.where(condition, x, y) Parameter : condition : [array_like,… Read More
numpy.ma.filled() function return input as an array with masked data replaced by a fill value. If arr is not a MaskedArray, arr itself is returned.… Read More
numpy.ma.MaskedArray.tolist() function return the data portion of the masked array as a hierarchical Python list. Syntax : numpy.ma.MaskedArray.tolist(fill_value = None) Parameters : axis : [scalar,… Read More
numpy.ma.is_masked() function determine whether input has masked values & accepts any object as input, but always returns False unless the input is a MaskedArray containing… Read More
numpy.ma.is_mask() function return True if parameter m is a valid, standard mask. This function does not check the contents of the input, only that the… Read More
numpy.ma.masked_all() function return an empty masked array of the given shape and dtype, where all the data are masked. Syntax : numpy.ma.masked_all(shape, dtype) Parameter :… Read More
numpy.ma.masked_all_like() function return an empty masked array of the same shape and dtype as the array arr, where all the data are masked. Syntax :… Read More
numpy.ma.fix_invalid() function return input with invalid data masked and replaced by a fill value. Where invalid data means values of nan, inf, etc. Syntax :… Read More
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… Read More
numpy.ma.choose() function use an index array to construct a new array from a set of choices. Given an array of integers and a set of… Read More
numpy.ma.MaskedArray.count() function count the non-masked elements of the array along the given axis. Syntax : numpy.ma.MaskedArray.count(self, axis=None, keepdims = no value) Parameters : axis :… Read More
numpy.ma.MaskedArray.nonzero() function return the indices of unmasked elements that are not zero. This function returns a tuple of arrays, one for each dimension, containing the… Read More
numpy.ma.notmasked_contiguous() function find contiguous unmasked data in a masked array along the given axis. Syntax : numpy.ma.notmasked_contiguous(arr, axis = None) Parameters : arr : [array_like]… Read More