Calculate the expanding quantile.
Quantile to compute. 0 <= quantile <= 1.
Deprecated since version 2.1.0: This will be renamed to ‘q’ in a future version.
This optional parameter specifies the interpolation method to use, when the desired quantile lies between two data points i and j:
linear: i + (j - i) * fraction, where fraction is the fractional part of the index surrounded by i and j.
lower: i.
higher: j.
nearest: i or j whichever is nearest.
midpoint: (i + j) / 2.
Include only float, int, boolean columns.
Added in version 1.5.0.
Return type is the same as the original object with np.float64 dtype.
See also
pandas.Series.expandingCalling expanding with Series data.
pandas.DataFrame.expandingCalling expanding with DataFrames.
pandas.Series.quantileAggregating quantile for Series.
pandas.DataFrame.quantileAggregating quantile for DataFrame.
Examples
>>> ser = pd.Series([1, 2, 3, 4, 5, 6], index=['a', 'b', 'c', 'd', 'e', 'f'])
>>> ser.expanding(min_periods=4).quantile(.25)
a NaN
b NaN
c NaN
d 1.75
e 2.00
f 2.25
dtype: float64
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.core.window.expanding.Expanding.quantile.html