【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 建议挂梯子安装

【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 【Python】WordCloud库的使用

 

 栗子1:

import wordcloud
txt="Life is stort,you need python"
c=wordcloud.WordCloud(\
    background_color="white")
c.generate(txt)
c.to_file("1.png")

【Python】WordCloud库的使用

 

 栗子2:

import wordcloud
import jieba
txt="Python是一种跨平台的计算机程序设计语言。\
     是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。\
     最初被设计用于编写自动化脚本(shell),\
     随着版本的不断更新和语言新功能的添加,\
     越多被用于独立的、大型项目的开发。"
c=wordcloud.WordCloud(width=1000,\
    height=700,font_path="msyh.ttc")
c.generate(" ".join(jieba.lcut(txt)))#对中文进行分词处理
c.to_file("1.png")

【Python】WordCloud库的使用

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-05-03
猜你喜欢
  • 2021-07-24
  • 2022-12-23
  • 2021-12-21
  • 2021-05-07
  • 2021-11-25
  • 2022-12-23
相关资源
相似解决方案