numpy.ma.maximum_fill_value()

numpy.ma.maximum_fill_value(obj) [source] Return the minimum value that can be represented by the dtype of an object. This function is useful for calculating a fill value suitable for taking the maximum of an array with a given dtype. Parameters: obj : {ndarray, dtype} An object that can be queried for it?s numeric type. Returns: val : scalar The minimum representable value. Raises: TypeError If obj isn?t a suitable numeric type. See also minimum_fill_value The inverse functi

numpy.ma.max()

numpy.ma.max(obj, axis=None, out=None, fill_value=None) [source] Return the maximum along a given axis. Parameters: axis : {None, int}, optional Axis along which to operate. By default, axis is None and the flattened input is used. out : array_like, optional Alternative output array in which to place the result. Must be of the same shape and buffer length as the expected output. fill_value : {var}, optional Value used to fill in the masked values. If None, use the output of maximum_fi

numpy.ma.mask_rows()

numpy.ma.mask_rows(a, axis=None) [source] Mask rows of a 2D array that contain masked values. This function is a shortcut to mask_rowcols with axis equal to 0. See also mask_rowcols Mask rows and/or columns of a 2D array. masked_where Mask where a condition is met. Examples >>> import numpy.ma as ma >>> a = np.zeros((3, 3), dtype=np.int) >>> a[1, 1] = 1 >>> a array([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) >>> a = ma.masked_equal(a

numpy.ma.mask_rowcols()

numpy.ma.mask_rowcols(a, axis=None) [source] Mask rows and/or columns of a 2D array that contain masked values. Mask whole rows and/or columns of a 2D array that contain masked values. The masking behavior is selected using the axis parameter. If axis is None, rows and columns are masked. If axis is 0, only rows are masked. If axis is 1 or -1, only columns are masked. Parameters: a : array_like, MaskedArray The array to mask. If not a MaskedArray instance (or if no array elements are mas

numpy.ma.mask_or()

numpy.ma.mask_or(m1, m2, copy=False, shrink=True) [source] Combine two masks with the logical_or operator. The result may be a view on m1 or m2 if the other is nomask (i.e. False). Parameters: m1, m2 : array_like Input masks. copy : bool, optional If copy is False and one of the inputs is nomask, return a view of the other input mask. Defaults to False. shrink : bool, optional Whether to shrink the output to nomask if all its values are False. Defaults to True. Returns: mask : outp

numpy.ma.mask_cols()

numpy.ma.mask_cols(a, axis=None) [source] Mask columns of a 2D array that contain masked values. This function is a shortcut to mask_rowcols with axis equal to 1. See also mask_rowcols Mask rows and/or columns of a 2D array. masked_where Mask where a condition is met. Examples >>> import numpy.ma as ma >>> a = np.zeros((3, 3), dtype=np.int) >>> a[1, 1] = 1 >>> a array([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) >>> a = ma.masked_equa

numpy.ma.MaskType

numpy.ma.MaskType [source] alias of bool_

numpy.ma.masked_where()

numpy.ma.masked_where(condition, a, copy=True) [source] Mask an array where a condition is met. Return a as an array masked where condition is True. Any masked values of a or condition are also masked in the output. Parameters: condition : array_like Masking condition. When condition tests floating point values for equality, consider using masked_values instead. a : array_like Array to mask. copy : bool If True (default) make a copy of a in the result. If False modify a in place and r

numpy.ma.masked_values()

numpy.ma.masked_values(x, value, rtol=1e-05, atol=1e-08, copy=True, shrink=True) [source] Mask using floating point equality. Return a MaskedArray, masked where the data in array x are approximately equal to value, i.e. where the following condition is True (abs(x - value) <= atol+rtol*abs(value)) The fill_value is set to value and the mask is set to nomask if possible. For integers, consider using masked_equal. Parameters: x : array_like Array to mask. value : float Masking value.

numpy.ma.masked_outside()

numpy.ma.masked_outside(x, v1, v2, copy=True) [source] Mask an array outside a given interval. Shortcut to masked_where, where condition is True for x outside the interval [v1,v2] (x < v1)|(x > v2). The boundaries v1 and v2 can be given in either order. See also masked_where Mask where a condition is met. Notes The array x is prefilled with its filling value. Examples >>> import numpy.ma as ma >>> x = [0.31, 1.2, 0.01, 0.2, -0.4, -1.1] >>> ma.masked_out