klyn.math.NDArray.argMin
method
public argMin(axis as Long, keepDims as Boolean = false, ignoreNaN as Boolean = false, where as Boolean[] = null, result as NDArray<Long> = null) as NDArray<Long>
Description

Returns the indices of the minimum values along one axis.

Parameters
ParameterDescription
axisAxis to reduce on any rank; negative axes count from the end.
keepDimsRetain reduced dimensions with length one.
resultOptional non-aliased destination of the exact output shape.
whereOptional flat Boolean selection mask.
ignoreNaNSkip NaNs; otherwise preserve this operation's default NaN contract.
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 or its numeric type is not ordered.
  • IndexException for an invalid axis.
  • ValueException for invalid mask/destination or no observations (except sum).
Example
import klyn.math

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