Python—做一个普普通通的词云
#导入wordcloud库
import wordcloud
#创建对象w,设置几个参数,宽度,高度,背景颜色
w=wordcloud.WordCloud(width=1000,
height=800,
background_color='white')
#生成词云
w.generate('Only the delicious food,Only the delicious food, listen with your heart to tell of the stomach.')
#保存到当前文件夹
w.to_file('ciyun.png')
超级简单的词云就做好啦
共有 0 条评论