klyn.math.NDArray.mean
method
public mean() as Double:
Description

Computes the arithmetic mean of all elements.

Returns

Mean value as Double.

Throws
  • ValueError if the array is empty.
Example
import klyn.math

a = NDArray<Int>.fromList([1, 2, 3, 4])
print(a.mean())  # 2.5