larray.Array.indexofmin

Array.indexofmin(axis=None) Union[Array, Tuple[int, ...]][source]

Return indices of the minimum values along a given axis.

Parameters
axisint or str or Axis, optional

Axis along which to work. If not specified, works on the full array.

Returns
Array

Notes

In case of multiple occurrences of the minimum values, the indices corresponding to the first occurrence are returned.

Examples

>>> nat = Axis('nat=BE,FR,IT')
>>> sex = Axis('sex=M,F')
>>> arr = Array([[0, 1], [3, 2], [2, 5]], [nat, sex])
>>> arr
nat\sex  M  F
     BE  0  1
     FR  3  2
     IT  2  5
>>> arr.indexofmin('sex')
nat  BE  FR  IT
      0   1   0
>>> arr.indexofmin()
(0, 0)