当前位置:网站首页>Pyechart drawing word cloud
Pyechart drawing word cloud
2022-06-22 01:39:00 【Dai Meng Ma】
The format should be adjusted to :[("python",3),(" technology ",4)] This format
Sample code
from pyecharts.faker import Faker
def plot_word(words_list: list):
from pyecharts.charts import WordCloud
freq = {
}
for value in words_list:
words_list = value.split(' ')
for word in words_list:
if word in freq.keys():
freq[word] += 1
else:
freq[word] = 1
# dict turn tuple list
keyword_list = []
for key, value in freq.items():
keyword_list.append((key, value))
# Use pyechart Start drawing
pyechart_word_cloud = WordCloud()
pyechart_word_cloud.add('', keyword_list, shape='circle')
pyechart_word_cloud.render("pyechart_word_cloud.html")
plot_word([' technology '] * 4 + ["python"] * 3 + ["word", 'cloud'] * 2 + [' data ', ' analysis '] + Faker.choose())
The effect is as follows :
边栏推荐
- PM2 learning
- Yang Bing: oceanbase helps digital transformation, and native distributed database becomes the first choice for core system
- 将列表分箱,并通过Pyechart绘制柱状图
- Idea prompt duplicated code fragment (15 lines long)
- 【NOI模拟赛】区间距离(分块,卷积)
- 数学知识复习:三重积分
- 動態規劃-01背包,分割等和子集,最後一塊石頭的重量
- . Several methods of obtaining hinstance in. Net
- Evc4 program cannot run on the emulator
- Some introduction and transplantation of lvgl
猜你喜欢

Classes and objects (Part 2)

Seeking an anti association detection tool, online detection of browser fingerprint

Creating a successful paradigm for cross-border e-commerce: Amazon cloud technology helps sellers lay out the next growth point

LeetCode 5242. Best English letters with both upper and lower case
![[number theory] leetcode1010 Pairs of Songs With Total Durations Divisible by 60](/img/cc/ca70945b1bb2f57093bbae721ca635.png)
[number theory] leetcode1010 Pairs of Songs With Total Durations Divisible by 60

High score schemes have been opened to the public, and the second round of the China "software Cup" remote sensing competition is coming!

【数论】leetcode1010. Pairs of Songs With Total Durations Divisible by 60

基于 LVM 创建和扩展 XFS 文件系统

PHP admin deployment - resolve all errors

出现UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xe9 in position 0: ordinal not in range解决方法
随机推荐
动态规划-01背包,分割等和子集,最后一块石头的重量
Evc4 program cannot run on the emulator
出现UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xe9 in position 0: ordinal not in range解决方法
想加入大厂?看这篇文章也许会帮助到你
刚学了一个炫酷3D三棱锥立体特效,快来看看
容器云是什么意思?与堡垒机有什么区别?
The use of PowerShell functions in mathematical expressions
Judge whether the system CPU is idle
Problems and solutions of non debug mode execution failure when using gomonkey
有没有亚马逊跨境电商适合用的浏览器排名
Scuba China trip - Suzhou station, online and offline limited time registration channel has been opened!
【Proteus仿真】INT0和INT1中断计数
Making unequal interval histogram with Matplotlib
C语言动态内存函数的应用
Virtual variables and formatting characters in debugging
华为云发布桌面IDE-CodeArts
[solution] Ming Chu Liang Zao video edge computing gateway solution
Is there a browser ranking suitable for Amazon cross-border E-commerce
Record the use process of webscraper
出现IOError: No translation files found for default language zh-cn.的解决方法