bundles / numpy latest / numpy / ma / core / set_fill_value
function
numpy.ma.core:set_fill_value
source: build-install/usr/lib/python3.14/site-packages/numpy/ma/core.py :508
Signature
def set_fill_value ( a , fill_value ) Summary
Set the filling value of a, if a is a masked array.
Extended Summary
This function changes the fill value of the masked array a in place. If a is not a masked array, the function returns silently, without doing anything.
Parameters
a: array_likeInput array.
fill_value: dtypeFilling value. A consistency test is performed to make sure the value is compatible with the dtype of
a.
Returns
: NoneNothing returned by this function.
Examples
import numpy as np import numpy.ma as ma a = np.arange(5) a a = ma.masked_where(a < 3, a) a ma.set_fill_value(a, -999) aNothing happens if `a` is not a masked array.
a = list(range(5)) a ma.set_fill_value(a, 100) a a = np.arange(5) a ma.set_fill_value(a, 100) a
See also
- MaskedArray.fill_value
Return current fill value.
- MaskedArray.set_fill_value
Equivalent method.
- maximum_fill_value
Return the default fill value for a dtype.
Aliases
-
numpy.ma.set_fill_value