numpy.ma.array()
numpy.ma.array
-
numpy.ma.array(data, dtype=None, copy=False, order=False, mask=False, fill_value=None, keep_mask=True, hard_mask=False, shrink=True, subok=True, ndmin=0)
[source] -
An array class with possibly masked values.
Masked values of True exclude the corresponding element from any computation.
Construction:
x = MaskedArray(data, mask=nomask, dtype=None, copy=False, subok=True, ndmin=0, fill_value=None, keep_mask=True, hard_mask=None, shrink=True)
Parameters: data : array_like
Input data.
mask : sequence, optional
Mask. Must be convertible to an array of booleans with the same shape as
data
. True indicates a masked (i.e. invalid) data.dtype : dtype, optional
Data type of the output. If
dtype
is None, the type of the data argument (data.dtype
) is used. Ifdtype
is not None and different fromdata.dtype
, a copy is performed.copy : bool, optional
Whether to copy the input data (True), or to use a reference instead. Default is False.
subok : bool, optional
Whether to return a subclass of
MaskedArray
if possible (True) or a plainMaskedArray
. Default is True.ndmin : int, optional
Minimum number of dimensions. Default is 0.
fill_value : scalar, optional
Value used to fill in the masked values when necessary. If None, a default based on the data-type is used.
keep_mask : bool, optional
Whether to combine
mask
with the mask of the input data, if any (True), or to use onlymask
for the output (False). Default is True.hard_mask : bool, optional
Whether to use a hard mask or not. With a hard mask, masked values cannot be unmasked. Default is False.
shrink : bool, optional
Whether to force compression of an empty mask. Default is True.
© 2008–2016 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.ma.array.html