numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
set_fill_value(a, fill_value)

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_like

Input array.

fill_value : dtype

Filling value. A consistency test is performed to make sure the value is compatible with the dtype of a.

Returns

None

Nothing returned by this function.

Set the filling value of a, if a is a masked array.

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.

Examples

This example is valid syntax, but we were not able to check execution
>>> import numpy.ma as ma
... a = np.arange(5)
... a array([0, 1, 2, 3, 4])
This example is valid syntax, but we were not able to check execution
>>> a = ma.masked_where(a < 3, a)
... a masked_array(data=[--, --, --, 3, 4], mask=[ True, True, True, False, False], fill_value=999999)
This example is valid syntax, but we were not able to check execution
>>> ma.set_fill_value(a, -999)
... a masked_array(data=[--, --, --, 3, 4], mask=[ True, True, True, False, False], fill_value=-999)

Nothing happens if a is not a masked array.

This example is valid syntax, but we were not able to check execution
>>> a = list(range(5))
... a [0, 1, 2, 3, 4]
This example is valid syntax, but we were not able to check execution
>>> ma.set_fill_value(a, 100)
... a [0, 1, 2, 3, 4]
This example is valid syntax, but we were not able to check execution
>>> a = np.arange(5)
... a array([0, 1, 2, 3, 4])
This example is valid syntax, but we were not able to check execution
>>> ma.set_fill_value(a, 100)
... a array([0, 1, 2, 3, 4])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.ma.core.minimum_fill_value dask.array.ma.set_fill_value numpy.ma.core.maximum_fill_value

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/ma/core.py#470
type: <class 'function'>
Commit: