Masked

class astropy.utils.masked.Masked(*args, **kwargs)[source]

Bases: NDArrayShapeMethods

A scalar value or array of values with associated mask.

The resulting instance will take its exact type from whatever the contents are, with the type generated on the fly as needed.

Parameters:
datanumpy:array_like

The data for which a mask is to be added. The result will be a a subclass of the type of data.

masknumpy:array_like of bool, optional

The initial mask to assign. If not given, taken from the data.

copybool

Whether the data and mask should be copied. Default: False.

Attributes Summary

mask

The mask.

unmasked

The unmasked values.

Methods Summary

filled(fill_value)

Get a copy of the underlying data, with masked values filled in.

from_unmasked(data[, mask, copy])

Create an instance from unmasked data and a mask.

Attributes Documentation

mask

The mask.

If set, replace the original mask, with whatever it is set with, using a view if no broadcasting or type conversion is required.

unmasked

The unmasked values.

Methods Documentation

filled(fill_value)[source]

Get a copy of the underlying data, with masked values filled in.

Parameters:
fill_valueobject

Value to replace masked values with.

classmethod from_unmasked(data, mask=None, copy=False)[source]

Create an instance from unmasked data and a mask.