小编ind*_*der的帖子

将Counter与列表一起使用

我如何使用集合库中的计数器将列表列表转换为每个单词整体出现次数的计数?

例如 [['a','b','a','c'], ['a','b','c','d']] -> {a:2, b:2, c:2, d:1}

a,b并且c发生在两个列表中但d仅发生在一个列表中.

python counter list python-2.7

6
推荐指数
2
解决办法
4595
查看次数

标签 统计

counter ×1

list ×1

python ×1

python-2.7 ×1