Statistics
Overview
The mk.stat entry point provides statistical operations on ndarrays. Functions are defined in the Statistics interface.
Available functions
Function | Description |
|---|---|
Arithmetic mean of all elements, or along an axis. | |
Median value of all elements. | |
Weighted average of all elements. |
For details and examples, see Descriptive Statistics.
Quick example
val a = mk.ndarray(mk[1.0, 2.0, 3.0, 4.0, 5.0])
mk.stat.mean(a) // 3.0
mk.stat.median(a) // 3.0
mk.stat.average(a) // 3.0 (uniform weights)
19 February 2026