polars.Series.quantile
-
Get the quantile value of this Series.
- Parameters:
-
- quantile
-
Quantile(s) between 0.0 and 1.0. Can be a single float or a list of floats.
-
interpolation{‘nearest’, ‘higher’, ‘lower’, ‘midpoint’, ‘linear’, ‘equiprobable’} -
Interpolation method.
- Returns:
-
- float | None | list[float] | list[None]
-
A single quantile value if a float is provided, or a list of quantile values if a list is provided.
Examples
>>> s = pl.Series("a", [1, 2, 3]) >>> s.quantile(0.5) 2.0Return a list of quantiles:
>>> s.quantile([0.25, 0.75], interpolation="linear") [1.5, 2.5]
Series.quantile(
quantile: float | list_[float],
interpolation: QuantileMethod = 'nearest',
) → float | None | list_[float] | list_[None]
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.quantile.html