Python语言程序设计
依神女苑
这个作者很懒,什么都没留下…
展开
-
解决:cannot import name ‘imread’ from ‘scipy.misc’
比如这段代码现在出现ImportError: cannot import name ‘imread’ from ‘scipy.misc’#GovRptWordCloudv1.pyimport jiebaimport wordcloudfrom scipy.misc import imreadmask = imread("fivestart.png")f = open("新时代中国特色社会主义.txt", "r", encoding = "utf-8")t = f.read()f.close(原创 2020-05-25 15:18:25 · 18866 阅读 · 7 评论 -
hamlet.txt英文哈姆雷特下载及实现文本词频统计
hamlet.txt全文下载:https://python123.io/resources/pye/hamlet.txtCalHamletV1.py:#CalHamletV1.pydef getText(): txt = open("hamlet.txt", "r").read() txt = txt.lower() for ch in '!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~': txt = txt.replace原创 2020-05-24 17:20:06 · 15287 阅读 · 8 评论 -
threekingdoms.txt中文三国演义下载及实现人物出场统计
threekingdoms.txt全文下载:https://python123.io/resources/pye/threekingdoms.txtCalThreeKingdomsV1.py:#CalThreeKingdomsV1.pyimport jiebatxt = open("threekingdoms.txt", "r", encoding = "utf-8").read()words = jieba.lcut(txt)counts = {}for word in words:原创 2020-05-24 17:16:38 · 6679 阅读 · 4 评论