- 博客(3)
- 收藏
- 关注
原创 【Python】词频统计
with open("要处理的文件名.csv","r",encoding="utf-8") as f: str1 = f.read()#读入文件str3 = str1.replace("\n",",")#替换换行符为逗号counts = {}#定义查询字典countsstr3= str3.split(",")#切割为以每个字符串为元素的数组for word in str3: #遍历数组元素查询 counts[word] = counts.get(word...
2021-11-11 10:19:04 553
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人