Skip to content

pd.Series.value_counts

pandas.Series.value_counts(normalize=False, sort=True, ascending=False, bins=None, dropna=True)

支持的参数

参数 数据类型 其他要求
normalize 布尔值 必须在编译时为常量
sort 布尔值 必须在编译时为常量
ascending 布尔值
bins
  • 整数
  • 类似数组的整数

示例用法

>>> @bodo.jit
... def f(S):
...     return S.value_counts()
>>> S = pd.Series(np.arange(100)) % 7
>>> f(S)
0    15
1    15
2    14
3    14
4    14
5    14
6    14
dtype: int64

重建索引 / 选择 / 标签操作