1.安装jieba库 舍友帮装的,我也不会( ╯□╰ ) 2.上网寻找政府工作报告 3.参照课本三国演义词频统计代码编写 import jieba txt = open("D:\政府工作报告.txt","r",encoding='utf-8').read() words = jieba.lcut(txt) counts = {} for word in words: if len(word) == 1: continue else: counts[word] = c
# 使用Python进行词频统计 mytext = """Background Industrial Light & Magic (ILM) was started by filmmaker George Lucas, . ILM has won numerous Academy Awards for Best Visual Effects, not to mention a string of Clio awards for its work on televisi
利用Python做一个词频统计 GitHub地址:FightingBob [Give me a star , thanks.] 词频统计 对纯英语的文本文件[Eg: 瓦尔登湖(英文版).txt]的英文单词出现的次数进行统计,并记录起来 代码实现 import string from os import path with open('瓦尔登湖(英文版).txt','rb') as text1: words = [word.strip(string.punctuation).lower() for