Return group values at the given quantile, a la numpy.percentile.
Value(s) between 0 and 1 providing the quantile(s) to compute.
Method to use when the desired quantile falls between two points.
Include only float, int or boolean data.
Added in version 1.5.0.
Changed in version 2.0.0: numeric_only now defaults to False.
Return type determined by caller of GroupBy object.
See also
Series.quantileSimilar method for Series.
DataFrame.quantileSimilar method for DataFrame.
numpy.percentileNumPy method to compute qth percentile.
Examples
>>> df = pd.DataFrame([
... ['a', 1], ['a', 2], ['a', 3],
... ['b', 1], ['b', 3], ['b', 5]
... ], columns=['key', 'val'])
>>> df.groupby('key').quantile()
val
key
a 2.0
b 3.0
© 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.groupby.SeriesGroupBy.quantile.html