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
  • ValueError if the array is empty.
Example
import klyn.math

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