klyn.math.NDArray.argMax
method
public argMax(ignoreNaN as Boolean = false, where as Boolean[] = null) as Long
Description

Returns the flat index of the maximum element.

Parameters
ParameterDescription
ignoreNaNSkip NaNs; otherwise retain the existing first-value comparison contract.
whereOptional flat Boolean mask, one entry per input element.
Returns

Zero-based row-major index.

Throws
  • ValueException if the array is empty or its numeric type is not ordered.
Example
import klyn.math

a = NDArray<Int>([[7, 3], [4, 9]])
print(a.argMax())  # 3