public mean(ignoreNaN as Boolean = false, where as Boolean[] = null) as Double
Computes the arithmetic mean of all elements.
| Parameter | Description |
|---|---|
ignoreNaN | Skip NaNs; otherwise propagate them. |
where | Optional flat Boolean mask with one entry per source element. |
Mean value as Double.
import klyn.math a = NDArray<Int>([1, 2, 3, 4]) print(a.mean()) # 2.5