oxtime

词云的生成

import wordcloud
import imageio
mask = imageio.imread(r"D:\python\7.17\test7.png") ##导入图片
f = open(r\'D:\python\z\', \'r\', encoding=\'utf8\') ##打开文档
data = f.read()
w = wordcloud.WordCloud(font_path=r\'C:\Windows\Fonts\微软雅黑\msyhbd\', mask=mask, width=1000, height=700,
background_color="white") ##选择字体
w.generate(data)
w.to_file(\'outfile.png\') ##输出png

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-10-06
  • 2021-06-04
  • 2021-12-08
  • 2021-11-04
  • 2021-06-07
  • 2022-12-23
猜你喜欢
  • 2020-05-07
  • 2021-08-07
  • 2021-11-01
  • 2021-09-05
  • 2021-12-18
  • 2021-12-25
  • 2021-12-09
相关资源
相似解决方案