klyn.math.NDArray.argMax
method
public argMax() as Int:
Description

Returns the flat index of the maximum 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>.fromList([[7, 3], [4, 9]])
print(a.argMax())  # 3