list 转换成dictionary,并统计词频

>>> from collections import Counter
>>> Counter(['apple','red','apple','red','red','pear'])
Counter({'red': 3, 'apple': 2, 'pear': 1})

   

   

   

posted @ 2019-01-31 19:06  simple_wxl  阅读(421)  评论(0编辑  收藏  举报