使用Python中的pyecharts库读取csv文件绘制词云

  • 效果展示
    *

    使用Python中的pyecharts库读取csv文件绘制词云_第1张图片

  • python代码

from pyecharts import WordCloud
import pandas as pd


wd = pd.read_csv('cp.csv')
word = [i[0] for i in wd[['关键词']].values]
value = [i[0] for i in wd[['词频']].values]
wordCloud = WordCloud(width=2000, height=2000)
wordCloud.add('词云', word, value, word_size_range=[10, 120], shape='star')
wordCloud.render('word.html')

  • 数据文件链接: https://pan.baidu.com/s/15oRNYvQGcLsdi6p3awRC_A 密码: riof

你可能感兴趣的:(pyecharts,Python)