statistics.median_grouped
Prev: statistics.median | Up: statistics | Next: statistics.median_high
Rel: statistics.correlation, statistics.covariance, statistics.fmean, statistics.geometric_mean
Ref: docs.python.org — statistics.median_grouped
Tags: #public #python3 #stdlib #statistics
Import
import statistics
from statistics import median_grouped
Signature & Overview
statistics.median_grouped(data, interval=1.0)
Estimates the median for numeric data binned around the midpoints of consecutive, fixed-width intervals.
Usage
import statistics
assert statistics.median_grouped([1, 2, 2, 3, 4], interval=1.0) == 2.25
Gotchas
- Interpolates median for continuous/binned data (returns
float).
REPL Inspect
from statistics import median_grouped
help(median_grouped)
Linked from
Related notes
- tuts/python3/stdlib_module/statistics/median Linked here; links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/median_high Linked here; links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/statistics/correlation Linked here; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/covariance Linked here; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/fmean Linked here; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/geometric_mean Linked here; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/harmonic_mean shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/kde shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/kde_random shared tags: #statistics, #stdlib