python词频统计

统计一篇英语文章中单词出现的次数,而后以单词出现频率从大到小输出 import string path = 'D:/WorkSpace/test02/Walden.txt' with open(path, 'r') as text: words = [raw_word.strip(string.punctuation).lower() for raw_word in text.read(
相关文章
相关标签/搜索