klyn.math.NDArray.min
method
public min(axis as Int) as NDArray<T>:
Description

Returns minimum values along one axis.

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

A 1D array containing the minimum values.

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.min(axis=0))  # [1, 2]