mindspore.numpy.argmin

mindspore.numpy.argmin(a, axis=None)[源代码]

Returns the indices of the minimum values along an axis.

说明

Numpy argument out is not supported.

参数
  • a (Union[int, float, bool, list, tuple, Tensor]) – Input array.

  • axis (int, optional) – By default, the index is into the flattened array, otherwise along the specified axis. Default: None.

返回

Tensor, array of indices into the array. It has the same shape as a.shape with the dimension along axis removed.

异常

ValueError – If axis is out of range.

Supported Platforms:

Ascend GPU CPU

样例

>>> import mindspore.numpy as np
>>> a = np.arange(10, 16).reshape(2, 3)
>>> print(np.argmin(a))
0
>>> print(np.argmin(a, axis=0))
[0 0 0]
>>> print(np.argmin(a, axis=1))
[0 0]