polars.Series.quantile#

Series.quantile(
quantile: float,
interpolation: RollingInterpolationMethod = 'nearest',
) float | None[source]#

Get the quantile value of this Series.

Parameters:
quantile

Quantile between 0.0 and 1.0.

interpolation{‘nearest’, ‘higher’, ‘lower’, ‘midpoint’, ‘linear’}

Interpolation method.

Examples

>>> s = pl.Series("a", [1, 2, 3])
>>> s.quantile(0.5)
2.0