pandas.api.typing.DataFrameGroupBy.quantile

pandas 3.1.1 · GroupBy · method

Estimate the value at a specified fraction of the sorted distribution.

Call syntax

pd.api.typing.DataFrameGroupBy.quantile(q=0.5, interpolation='linear', numeric_only=False)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
q Optional
Positional or keyword
Default 0.5
float or array-like

Provide quantiles as fractions between 0 and 1, or a number of quantile bins for qcut.

interpolation Optional
Positional or keyword
Default 'linear'
{'linear', 'lower', 'higher', 'midpoint', 'nearest'}

Choose how to compute results that fall between observed values.

numeric_only Optional
Positional or keyword
Default False
bool

Restrict the calculation to columns pandas considers numeric where applicable.

Returns

Series or DataFrame