xorbits.numpy.nanargmin#

xorbits.numpy.nanargmin(a, axis=None, out=None, combine_size=None)[源代码]#

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.

参数
  • 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.

    1.22.0(numpy) 新版功能.

  • keepdims (bool, optional (Not supported yet)) –

    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.

    1.22.0(numpy) 新版功能.

返回

index_array – An array of indices or a single index value.

返回类型

ndarray

参见

argmin, nanargmax

实际案例

>>> 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])
combine_size: int, optional

The number of chunks to combine.

This docstring was copied from numpy.