modin.pandas.Series.value_counts¶
- Series.value_counts(normalize: bool = False, sort: bool = True, ascending: bool = False, bins: int | None = None, dropna: bool = True)[source]¶
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.
- Parameters:
normalize (bool, default False) – If True then the object returned will contain the relative frequencies of the unique values. Being different from native pandas, Snowpark pandas will return a Series with decimal.Decimal values.
sort (bool, default True) – Sort by frequencies when True. Preserve the order of the data when False. When there is a tie between counts, the order is still deterministic, but may be different from the result from native pandas.
ascending (bool, default False) – Sort in ascending order.
bins (int, optional) – Rather than count values, group them into half-open bins, a convenience for
pd.cut, only works with numeric data. This argument is not supported yet.dropna (bool, default True) – Don’t include counts of NaN.
- Return type:
See also
Series.countNumber of non-NA elements in a Series.
DataFrame.countNumber of non-NA elements in a DataFrame.
DataFrame.value_countsEquivalent method on DataFrames.
Examples
With normalize set to True, returns the relative frequency by dividing all values by the sum of values.
dropna
With dropna set to False we can also see NaN index values.