MaskedArray

nlcpy.ma.MaskedArray is the NLCPy counterpart of NumPy numpy.ma.MaskedArray.

For the basic concept of MaskedArray, please refer to the NumPy documentation.

Attention

In the current NLCPy, masked version operations are only supported by four arithmetic operations in nlcpy.ma. Other functions may raise TypeError or treat MaskedArray as ndarray.

MaskedArray class

nlcpy.ma.MaskedArray

An array class with possibly masked values.

Masked Array Operations

Creation

From existing data

nlcpy.ma.masked_array

alias of nlcpy.ma.core.MaskedArray

nlcpy.ma.copy

Returns a copy of the array.

nlcpy.ma.array

Shortcut to MaskedArray.

Inspecting the array

nlcpy.ma.getmask

Returns the mask of a masked array, or nomask.

nlcpy.ma.getmaskarray

Returns the mask of a masked array, or full boolean array of False.

nlcpy.ma.getdata

Returns the data of a masked array as an ndarray.

nlcpy.ma.is_mask

Returns True if m is a valid, standard mask.

Manipulating a MaskedArray

Changing the shape

nlcpy.ma.ravel

Returns a contiguous flattened array.

nlcpy.ma.reshape

Returns an array containing the same data with a new shape.

nlcpy.ma.resize

Returns a new masked array with the specified size and shape.

Modifying axes

nlcpy.ma.swapaxes

Interchanges two axes of an array.

nlcpy.ma.transpose

Permutes the dimensions of an array.

Operations on masks

Creating a mask

nlcpy.ma.make_mask

Creates a boolean mask from an array.

nlcpy.ma.make_mask_none

Returns a boolean mask of the given shape, filled with False.

Modifying a mask

nlcpy.ma.harden_mask

Forces the mask to hard.

nlcpy.ma.soften_mask

Forces the mask to soft.

Conversion operations

> to a ndarray

nlcpy.ma.filled

Returns input as an array with masked data replaced by a fill value.

Filling a masked array

nlcpy.ma.default_fill_value

Returns the default fill value for the argument object.