klyn.math.NDArray.argMin
method
public argMin(axis as Int) as NDArray<UInt>:
Description

Returns the indices of the minimum values along one axis.

Parameters
ParameterDescription
axis0 for columns, 1 for rows on 2D arrays.
Returns

A 1D array containing the first zero-based index of each minimum value.

Throws
  • IndexException if the axis does not exist.
  • ValueException if the array is empty, has unsupported dimensions or its numeric type is not ordered.
Example
import klyn.math

a = NDArray<Int>.fromList([[3, 2], [1, 4]])
print(a.argMin(axis=0))  # [1, 0]