numpy.ma.fix_invalid

numpy.ma.fix_invalid(a, mask=False, copy=True, fill_value=None)

Return (a copy of) a where invalid data (nan/inf) are masked and replaced by fill_value.

Note that a copy is performed by default (just in case...).

Parameters:

a : array_like

A (subclass of) ndarray.

copy : bool

Whether to use a copy of a (True) or to fix a in place (False).

fill_value : {var}, optional

Value used for fixing invalid data. If not given, the output of get_fill_value(a) is used instead.

Returns:

b : MaskedArray

Previous topic

numpy.ma.asanyarray

Next topic

numpy.ma.masked_equal

This Page

Quick search