How to make word Cloud Picture with pyecharts in python
This article is about how Python uses pyecharts to create word clouds. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
Pyecharts needs to be installed
pip install pyecharts -U
Create [demo6.py] and enter the following code:
from pyecharts import options as optsfrom pyecharts.charts import Page, WordCloud words = [ ("Miracle Doctor", 10000), ("Ma Liang", 6181); ("Mary," 4386), (Terminator, 4055), ("Blue Star," 2467), (Wisdom, 2244); ("Military Industry," 1868), ("Blood Spot," 1281)] def wordcloud_base() -> WordCloud: c = ( WordCloud() .add("", words, word_size_range=[20, 100]) .set_global_opts(title_opts=opts.TitleOpts(title="Basic Examples")) ) return c wd = wordcloud_base()wd.render("word_demo.html")
click the execute
Open the generated html file
double-click to open
The renderings are as follows:
Thank you for reading! About "python how to use pyecharts to make word cloud map" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!