bundles / numpy 2.4.4 / numpy / nanargmin
_ArrayFunctionDispatcher
numpy:nanargmin
Signature
def nanargmin ( a , axis = None , out = None , * , keepdims = <no value> ) Summary
Return the indices of the minimum 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.
Parameters
a: array_likeInput data.
axis: int, optionalAxis along which to operate. By default flattened input is used.
out: array, optionalIf provided, the result will be inserted into this array. It should be of the appropriate shape and dtype.
keepdims: bool, optionalIf 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.
Returns
index_array: ndarrayAn array of indices or a single index value.
Examples
import numpy as np a = np.array([[np.nan, 4], [2, 3]])✓
np.argmin(a) np.nanargmin(a)✗
np.nanargmin(a, axis=0) np.nanargmin(a, axis=1)✓
See also
- argmin
- nanargmax
Aliases
-
numpy.nanargmin