失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > python collections.Counter

python collections.Counter

时间:2022-03-27 07:00:04

相关推荐

python collections.Counter

1、问题描述

使用python自带的collections喜爱的Counter函数能够清点数组中每个类别及对应的个数

2、例子

df = pd.read_excel('2.xlsx')y = df.iloc[:,-1]print(Counter(y))#Counter({0: 1865, 1: 99})#

如果觉得《python collections.Counter》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。