MaskedArray.nonzero()

MaskedArray.nonzero() [source] Return the indices of unmasked elements that are not zero. Returns a tuple of arrays, one for each dimension, containing the indices of the non-zero elements in that dimension. The corresponding non-zero values can be obtained with: a[a.nonzero()] To group the indices by element, rather than dimension, use instead: np.transpose(a.nonzero()) The result of this is always a 2d array, with a row for each non-zero element. Parameters: None Returns: tuple_of_ar

MaskedArray.ndim

MaskedArray.ndim Number of array dimensions. Examples >>> x = np.array([1, 2, 3]) >>> x.ndim 1 >>> y = np.zeros((2, 3, 4)) >>> y.ndim 3

MaskedArray.nbytes

MaskedArray.nbytes Total bytes consumed by the elements of the array. Notes Does not include memory consumed by non-element attributes of the array object. Examples >>> x = np.zeros((3,5,2), dtype=np.complex128) >>> x.nbytes 480 >>> np.prod(x.shape) * x.itemsize 480

MaskedArray.min()

MaskedArray.min(axis=None, out=None, fill_value=None) [source] Return the minimum 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 minimum_fill

MaskedArray.mean()

MaskedArray.mean(axis=None, dtype=None, out=None) [source] Returns the average of the array elements. Masked entries are ignored. The average is taken over the flattened array by default, otherwise over the specified axis. Refer to numpy.mean for the full documentation. Parameters: a : array_like Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted. axis : int, optional Axis along which the means are computed. The default is to compute the mean

MaskedArray.max()

MaskedArray.max(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_fill

MaskedArray.mask

MaskedArray.mask Mask

MaskedArray.itemsize

MaskedArray.itemsize Length of one array element in bytes. Examples >>> x = np.array([1,2,3], dtype=np.float64) >>> x.itemsize 8 >>> x = np.array([1,2,3], dtype=np.complex128) >>> x.itemsize 16

MaskedArray.item()

MaskedArray.item(*args) Copy an element of an array to a standard Python scalar and return it. Parameters: *args : Arguments (variable number and type) none: in this case, the method only works for arrays with one element (a.size == 1), which element is copied into a standard Python scalar object and returned. int_type: this argument is interpreted as a flat index into the array, specifying which element to copy and return. tuple of int_types: functions as does a single int_type argument,

MaskedArray.iscontiguous()

MaskedArray.iscontiguous() [source] Return a boolean indicating whether the data is contiguous. Parameters: None Examples >>> x = np.ma.array([1, 2, 3]) >>> x.iscontiguous() True iscontiguous returns one of the flags of the masked array: >>> x.flags C_CONTIGUOUS : True F_CONTIGUOUS : True OWNDATA : False WRITEABLE : True ALIGNED : True UPDATEIFCOPY : False