pandas.api.typing.DataFrameGroupBy.nunique

pandas 3.1.1 · GroupBy · method

Count distinct values. Set dropna=False to count missing values where supported.

Call syntax

pd.api.typing.DataFrameGroupBy.nunique(dropna=True)

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
dropna Optional
Positional or keyword
Default True
bool

Choose whether to drop missing values or missing keys from consideration.

Returns

nunique: DataFrame