MaskedArray.set_fill_value()

numpy.ma.MaskedArray.set_fill_value

MaskedArray.set_fill_value(value=None) [source]

Set the filling value of the masked array.

Parameters:

value : scalar, optional

The new filling value. Default is None, in which case a default based on the data type is used.

See also

ma.set_fill_value
Equivalent function.

Examples

>>> x = np.ma.array([0, 1.], fill_value=-np.inf)
>>> x.fill_value
-inf
>>> x.set_fill_value(np.pi)
>>> x.fill_value
3.1415926535897931

Reset to default:

>>> x.set_fill_value()
>>> x.fill_value
1e+20

© 2008–2017 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.12.0/reference/generated/numpy.ma.MaskedArray.set_fill_value.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部