Statistics Functions
statistics.median_grouped()
Estimate a median from grouped observations represented by bin midpoints. The supplied interval is the common bin width; the caller must ensure valid equally spaced bins.
Formal Syntax & Structure
python syntaxpython
statistics.median_grouped(data, interval=1.0)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| data | iterable of numbers | Observations used by the statistic. |
| interval | float | Common positive bin width. |
Return Value
float
Floating-point result; finite precision and domain restrictions apply.
Working Example
Example Snippetpython
import statisticsprint(statistics.median_grouped([10, 10, 20, 20, 20], interval=10))