python--更干净的词频统计

上篇文章(python--10行代码搞定词频统计)咱们介绍了利用Counter模块轻松搞定词频统计的方法,由于重点是介绍模块的使用,代码显得比较粗糙。python import re,collections def get_nums(file): with open (file) as f: words_box=[] for line in f:
相关文章
相关标签/搜索