On this page
statistics.quantiles
Prev: statistics.pvariance | Up: statistics | Next: statistics.StatisticsError
Rel: statistics.correlation, statistics.covariance, statistics.fmean, statistics.geometric_mean
Ref: docs.python.org โ statistics.quantiles
Tags: #public #python3 #stdlib #statistics
Import
import statistics
from statistics import quantiles
Signature & Overview
statistics.quantiles(data, *, n=4, method='exclusive')
Divide data into n continuous intervals with equal probability.
Usage
import statistics
q1, q2, q3 = statistics.quantiles([1, 2, 3, 4, 5, 6, 7, 8], n=4)
assert q2 == 4.5
Gotchas
- Returns
n - 1cut points (n=4โ quartiles,n=100โ percentiles).
REPL Inspect
from statistics import quantiles
help(quantiles)
Linked from
Related notes
- tuts/python3/stdlib_module/statistics/pvariance Linked here; links to this page; shared tags: #statistics, #stdlib
- tuts/python3/stdlib_module/statistics/StatisticsError 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