>>> from collections import Counter>>> Counter([‘apple‘,‘red‘,‘apple‘,‘red‘,‘red‘,‘pear‘])Counter({‘red‘: 3, ‘apple‘: 2, ‘pear‘: 1})
? ?
list 转换成dictionary,并统计词频
原文:https://www.cnblogs.com/wuxiangli/p/10343284.html