python-wordcloud 笔记整理

权当个人自学使用,仅供参考
Reference:
某自己学校老师编的python程序设计基础
https://www.cnblogs.com/randysun/p/11215095.html

基本入门

import wordcloud

w = wordcloud.WordCloud()
#载入字符串
w.generate("Python and WordCloud")
#输出为png图片
w.to_file("pywordcloud.png")

参数列表
python-wordcloud 笔记整理_第1张图片

from wordcloud import WordCloud
#长宽、背景色
wc1 = WordCloud(width = 1500, height = 900, background_color = 'white')
wc1.generate("A little word cloud generator... wordcloud depends on numpy and pillow. To save the wordcloud into a file, matplotlib can also be installed. See examp")
wc1.to_file('wc.png')

python-wordcloud 笔记整理_第2张图片

更多更详细请直达这里

你可能感兴趣的:(python',数据科学,统计学)