counter统计数量分布
统计数量分布
from collections import Counter
print(sorted(Counter(y).items()))
numpy中数据统计bincount
如果是非负整数:
如果是浮点数:
pandas中Series频数统计value_counts
Series.value_counts()
统计数量分布
from collections import Counter
print(sorted(Counter(y).items()))
如果是非负整数:
如果是浮点数:
Series.value_counts()