bigframes.pandas.MultiIndex.value_counts#
- MultiIndex.value_counts(normalize: bool = False, sort: bool = True, ascending: bool = False, *, dropna: bool = True)#
Return a Series containing counts of unique values.
The resulting object will be in descending order so that the first element is the most frequently-occurring element. Excludes NA values by default.
Examples:
>>> index = bpd.Index([3, 1, 2, 3, 4, np.nan]) >>> index.value_counts() 3.0 2 1.0 1 2.0 1 4.0 1 Name: count, dtype: Int64
With normalize set to True, returns the relative frequency by dividing all values by the sum of values.
>>> s = bpd.Series([3, 1, 2, 3, 4, np.nan]) >>> s.value_counts(normalize=True) 3.0 0.4 1.0 0.2 2.0 0.2 4.0 0.2 Name: proportion, dtype: Float64
dropnaWith dropna set to False we can also see NaN index values.
>>> s.value_counts(dropna=False) 3.0 2 1.0 1 2.0 1 4.0 1 <NA> 1 Name: count, dtype: Int64
- Parameters:
- Returns:
bigframes.pandas.Series