mindspore.numpy.argmin

View Source On Gitee
mindspore.numpy.argmin(a, axis=None)[source]

Returns the indices of the minimum values along an axis.

Note

Numpy argument out is not supported.

Parameters
  • 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 .

Returns

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

Raises

ValueError – If axis is out of range.

Supported Platforms:

Ascend GPU CPU

Examples

>>> 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]