numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturns
_replace_nan(a, val)

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-like

Input array.

val : float

NaN values are set to val before doing the operation.

Returns

y : ndarray

If a is of inexact type, return a copy of a with the NaNs replaced by the fill value, otherwise return a.

mask: {bool, None}

If a is of inexact type, return a boolean mask marking locations of NaNs, otherwise return None.

If a is of inexact type, make a copy of a, replace NaNs with the :None:None:`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.

Examples

See :

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/lib/nanfunctions.py#68
type: <class 'function'>
Commit: