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)

Arrays with possibly masked values. Masked values of True exclude the corresponding element from any computation.

Construction:
x = MaskedArray(data, mask=nomask, dtype=None, copy=True, fill_value=None, keep_mask=True, hard_mask=False, shrink=True)
Parameters:

data : {var}

Input data.

mask : {nomask, sequence}, optional

Mask. Must be convertible to an array of booleans with the same shape as data: True indicates a masked (eg., invalid) data.

dtype : {dtype}, optional

Data type of the output. If dtype is None, the type of the data argument (data.dtype) is used. If dtype is not None and different from data.dtype, a copy is performed.

copy : {False, True}, optional

Whether to copy the input data (True), or to use a reference instead. Note: data are NOT copied by default.

subok : {True, False}, optional

Whether to return a subclass of MaskedArray (if possible) or a plain MaskedArray.

ndmin : {0, int}, optional

Minimum number of dimensions

fill_value : {var}, optional

Value used to fill in the masked values when necessary. If None, a default based on the datatype is used.

keep_mask : {True, boolean}, optional

Whether to combine mask with the mask of the input data, if any (True), or to use only mask for the output (False).

hard_mask : {False, boolean}, optional

Whether to use a hard mask or not. With a hard mask, masked values cannot be unmasked.

shrink : {True, boolean}, optional

Whether to force compression of an empty mask.

Previous topic

numpy.ma.masked_array

Next topic

numpy.ma.copy

This Page

Quick search