阅读目录
2、导入词云包
1 from wordcloud import WordCloud, ImageColorGenerator
3、构造WordCloud对象
1 wc = WordCloud( 2 background_color = p_background 3 , max_words = p_max_words #显示最大词数 4 , font_path = "msyh.ttf" 5 , min_font_size = p_min_font_size 6 , max_font_size = p_max_font_size 7 , width = p_width #图幅宽度 8 , height = p_height 9 , mask = cloud_mask 10 )
4、生成词云结果
1 result = wc.generate(cloud_text)5、保存词云结果为图片
1 wordCloudFile = os.getcwd() + "\\wordCloud.png"2 if os.path.exists(wordCloudFile) : 3 os.remove(wordCloudFile) 4 result.to_file(wordCloudFile)
50000+
5万行代码练就真实本领
17年
创办于2008年老牌培训机构
1000+
合作企业
98%
就业率



