numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
nanargmax(a, axis=None, out=None, *, keepdims=<no value>)

Parameters

a : array_like

Input data.

axis : int, optional

Axis along which to operate. By default flattened input is used.

out : array, optional

If provided, the result will be inserted into this array. It should be of the appropriate shape and dtype.

versionadded
keepdims : bool, optional

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the array.

versionadded

Returns

index_array : ndarray

An array of indices or a single index value.

Return the indices of the maximum values in the specified axis ignoring NaNs. For all-NaN slices ValueError is raised. Warning: the results cannot be trusted if a slice contains only NaNs and -Infs.

See Also

argmax
nanargmin

Examples

>>> a = np.array([[np.nan, 4], [2, 3]])
... np.argmax(a) 0
>>> np.nanargmax(a)
1
>>> np.nanargmax(a, axis=0)
array([1, 0])
>>> np.nanargmax(a, axis=1)
array([1, 1])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.nanargmin numpy.lib.nanfunctions

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#562
type: <class 'function'>
Commit: