Statistics Functions
statistics.quantiles()
Estimate n-1 cut points using exclusive or inclusive interpolation. In Python 3.13 a single observation is accepted; empty data is invalid.
Formal Syntax & Structure
python syntaxpython
statistics.quantiles(data, *, n=4, method='exclusive')Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| data | iterable of numbers | Observations used by the statistic. |
| n | int | Number of intervals (at least one). |
| method | str | Choose exclusive or inclusive interpolation. |
Return Value
list[number]
List of interpolated numeric cut points.
Working Example
Example Snippetpython
import statisticsprint(statistics.quantiles([0, 10, 20, 30, 40], n=4, method='inclusive'))