A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.filled.html below:

numpy.ma.filled — NumPy v2.3 Manual

numpy.ma.filled#
ma.filled(a, fill_value=None)[source]#

Return input as an ndarray, with masked values replaced by fill_value.

If a is not a MaskedArray, a itself is returned. If a is a MaskedArray with no masked values, then a.data is returned. If a is a MaskedArray and fill_value is None, fill_value is set to a.fill_value.

Parameters:
aMaskedArray or array_like

An input object.

fill_valuearray_like, optional.

Can be scalar or non-scalar. If non-scalar, the resulting filled array should be broadcastable over input array. Default is None.

Returns:
andarray

The filled array.

Examples

>>> import numpy as np
>>> import numpy.ma as ma
>>> x = ma.array(np.arange(9).reshape(3, 3), mask=[[1, 0, 0],
...                                                [1, 0, 0],
...                                                [0, 0, 0]])
>>> x.filled()
array([[999999,      1,      2],
       [999999,      4,      5],
       [     6,      7,      8]])
>>> x.filled(fill_value=333)
array([[333,   1,   2],
       [333,   4,   5],
       [  6,   7,   8]])
>>> x.filled(fill_value=np.arange(3))
array([[0, 1, 2],
       [0, 4, 5],
       [6, 7, 8]])

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4