riesGroupBy.rolling ](pandas.core.groupby.SeriesGroupBy.rolling.html)
    * [ pandas.core.groupby.SeriesGroupBy.sample ](pandas.core.groupby.SeriesGroupBy.sample.html)
    * [ pandas.core.groupby.SeriesGroupBy.sem ](pandas.core.groupby.SeriesGroupBy.sem.html)
    * [ pandas.core.groupby.SeriesGroupBy.shift ](pandas.core.groupby.SeriesGroupBy.shift.html)
    * [ pandas.core.groupby.SeriesGroupBy.size ](pandas.core.groupby.SeriesGroupBy.size.html)
    * [ pandas.core.groupby.SeriesGroupBy.skew ](pandas.core.groupby.SeriesGroupBy.skew.html)
    * [ pandas.core.groupby.SeriesGroupBy.std ](pandas.core.groupby.SeriesGroupBy.std.html)
    * [ pandas.core.groupby.SeriesGroupBy.sum ](pandas.core.groupby.SeriesGroupBy.sum.html)
    * [ pandas.core.groupby.SeriesGroupBy.var ](pandas.core.groupby.SeriesGroupBy.var.html)
    * [ pandas.core.groupby.SeriesGroupBy.tail ](pandas.core.groupby.SeriesGroupBy.tail.html)
    * [ pandas.core.groupby.SeriesGroupBy.take ](pandas.core.groupby.SeriesGroupBy.take.html)
    * [ pandas.core.groupby.SeriesGroupBy.value_counts ](pandas.core.groupby.SeriesGroupBy.value_counts.html)
    * [ pandas.core.groupby.DataFrameGroupBy.boxplot ](pandas.core.groupby.DataFrameGroupBy.boxplot.html)
    * [ pandas.core.groupby.DataFrameGroupBy.hist ](pandas.core.groupby.DataFrameGroupBy.hist.html)
    * [ pandas.core.groupby.SeriesGroupBy.hist ](pandas.core.groupby.SeriesGroupBy.hist.html)
    * [ pandas.core.groupby.DataFrameGroupBy.plot ](pandas.core.groupby.DataFrameGroupBy.plot.html)
    * [ pandas.core.groupby.SeriesGroupBy.plot ](pandas.core.groupby.SeriesGroupBy.plot.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ GroupBy ](../groupby.html)
  * pandas.core.... 

#  pandas.core.groupby.DataFrameGroupBy.value_counts  #

DataFrameGroupBy.  value_counts  (  _ subset  =  None  _ , _ normalize  =
False  _ , _ sort  =  True  _ , _ ascending  =  False  _ , _ dropna  =  True
_ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/groupby/generic.py#L2265-L2376) #

    

Return a Series or DataFrame containing counts of unique rows.

New in version 1.4.0.

Parameters  :

    

**subset** list-like, optional

    

Columns to use when counting unique combinations.

**normalize** bool, default False

    

Return proportions rather than frequencies.

**sort** bool, default True

    

Sort by frequencies.

**ascending** bool, default False

    

Sort in ascending order.

**dropna** bool, default True

    

Donât include counts of rows that contain NA values.

Returns  :

    

Series or DataFrame

    

Series if the groupby as_index is True, otherwise DataFrame.

See also

` Series.value_counts  `

    

Equivalent method on Series.

` DataFrame.value_counts  `

    

Equivalent method on DataFrame.

[ ` SeriesGroupBy.value_counts  `
](pandas.core.groupby.SeriesGroupBy.value_counts.html#pandas.core.groupby.SeriesGroupBy.value_counts
"pandas.core.groupby.SeriesGroupBy.value_counts")

    

Equivalent method on SeriesGroupBy.

Notes

  * If the groupby as_index is True then the returned Series will have a MultiIndex with one level per input column. 

  * If the groupby as_index is False then the returned DataFrame will have an additional column with the value_counts. The column is labelled âcountâ or âproportionâ, depending on the ` normalize  ` parameter. 

By default, rows that contain any NA values are omitted from the result.

By default, the result will be in descending order so that the first element
of each group is the most frequently-occurring row.

Examples

    
    
    >>> df = pd.DataFrame({
    ...     'gender': ['male', 'male', 'female', 'male', 'female', 'male'],
    ...     'educat