Loading...
统计词频from collections import Counter colors = ['red', 'blue', 'red', 'green', 'blue', 'blue'] c = Counter(colors) print (dict(c))Counter操作可以创建一个空的Counter:cnt = Counter() 1之后在空的Counter上进行一些操作。也可以创建的时...