会员
众包
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
走位,走位
博客园
首页
新随笔
联系
订阅
管理
2021年11月1日
学习python--023 Counter()函数
摘要: Counter函数旨在为我们统计列表中元素的数量并排序,非常适合词袋模型使用。 from collections import Counter b = [1, 2, 3, 4, 1, 2, 1, 1, 4, 'a', 'a'] c = Counter(b) >>> Counter({1: 4, 2:
阅读全文
posted @ 2021-11-01 20:25 走位,走位
阅读(165)
评论(0)
推荐(0)
编辑
公告