摘要: from wordcloud import WordCloud import matplotlib.pyplot as plt import jieba # 生成词云 def create_word_cloud(filename): with open('hongloumong.txt',encod 阅读全文
posted @ 2020-04-05 22:14 可乐配牛奶 阅读(405) 评论(0) 推荐(0) 编辑
摘要: 一、python字符串替换可以用两种方法实现: 1.用字符串本身的方法 2.用正则来替换字符串 下面用个例子来实验: a = 'hello word' 我把a字符串里的word替换为python 1.用字符串本身的replace方法 a.replace('word' , 'python') 输出结果 阅读全文
posted @ 2020-04-05 10:54 可乐配牛奶 阅读(29497) 评论(0) 推荐(1) 编辑