dask.array.nanargmin

dask.array.nanargmin

dask.array.nanargmin(a, axis=None, keepdims=False, split_every=None, out=None)[source]

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.

This docstring was copied from numpy.nanargmin.

Some inconsistencies with the Dask version may exist.

Parameters
aarray_like

Input data.

axisint, optional

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

outarray, optional

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

New in version 1.22.0.

keepdimsbool, 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.

New in version 1.22.0.

Returns
index_arrayndarray

An array of indices or a single index value.

See also

argmin, nanargmax

Examples

>>> import numpy as np  
>>> a = np.array([[np.nan, 4], [2, 3]])  
>>> np.argmin(a)  
0
>>> np.nanargmin(a)  
2
>>> np.nanargmin(a, axis=0)  
array([1, 1])
>>> np.nanargmin(a, axis=1)  
array([1, 0])