This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / ma / core / default_fill_value

function

numpy.ma.core:default_fill_value

source: build-install/usr/lib/python3.14/site-packages/numpy/ma/core.py :248

Signature

def   default_fill_value ( obj )

Summary

Return the default fill value for the argument object.

Extended Summary

The default filling value depends on the datatype of the input array or the type of the input scalar:

===========  ========
datatype      default
===========  ========
bool         True
int          999999
float        1.e20
complex      1.e20+0j
object       '?'
string       'N/A'
StringDType  'N/A'
===========  ========

For structured types, a structured scalar is returned, with each field the default fill value for its type.

For subarray types, the fill value is an array of the same size containing the default scalar fill value.

Parameters

obj : ndarray, dtype or scalar

The array data-type or scalar for which the default fill value is returned.

Returns

fill_value : scalar

The default fill value.

Examples

import numpy as np
np.ma.default_fill_value(1)
np.ma.default_fill_value(np.array([1.1, 2., np.pi]))
np.ma.default_fill_value(np.dtype(complex))

Aliases

  • numpy.ma.default_fill_value