bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / lib / _nanfunctions_impl / _replace_nan
function
numpy.lib._nanfunctions_impl:_replace_nan
source: build-install/usr/lib/python3.14/site-packages/numpy/lib/_nanfunctions_impl.py :70
Signature
def _replace_nan ( a , val ) Summary
If a is of inexact type, make a copy of a, replace NaNs with the val value, and return the copy together with a boolean mask marking the locations where NaNs were present. If a is not of inexact type, do nothing and return a together with a mask of None.
Extended Summary
Note that scalars will end up as array scalars, which is important for using the result as the value of the out argument in some operations.
Parameters
a: array-likeInput array.
val: floatNaN values are set to val before doing the operation.
Returns
y: ndarrayIf
ais of inexact type, return a copy ofawith the NaNs replaced by the fill value, otherwise returna.: mask: {bool, None}If
ais of inexact type, return a boolean mask marking locations of NaNs, otherwise return None.
Aliases
-
numpy.lib._nanfunctions_impl._replace_nan