xarray.DataArray.to_masked_array

xarray.DataArray.to_masked_array#

DataArray.to_masked_array(copy=True)[source]#

Convert this array into a numpy.ma.MaskedArray

Parameters

copy (bool, default: True) – If True make a copy of the array in the result. If False, a MaskedArray view of DataArray.values is returned.

Returns

result (MaskedArray) – Masked where invalid values (nan or inf) occur.