-
# -*- coding: utf-8 -*-
-
"""
-
Created on Wed Jun 5 14:07:47 2019
-
-
@author: ASUS
-
"""
-
-
import pandas as pd
-
from pyecharts import WordCloud
-
df=pd.read_excel(‘wx.xlsx‘)
-
city_list = df[‘城市‘].fillna(‘city‘).tolist()
-
count_city = pd.value_counts(city_list)
-
name = count_city.index.tolist()
-
value = count_city.tolist()
-
wordcloud=WordCloud(width=1300, height=620)
-
wordcloud.add("", name, value, word_size_range=[20, 100])
-
wordcloud.show_config()
-
wordcloud.render(r‘wxcity.html‘)
-
print(1)
-
# -*- coding: utf-8 -*-
-
"""
-
Created on Wed Jun 5 14:08:21 2019
-
-
@author: ASUS
-
"""
-
-
import pandas as pd
-
from pyecharts import Map
-
df=pd.read_excel(‘wx.xlsx‘)
-
pr_list = df[‘省份‘].fillna(‘pr‘).tolist()
-
count_pr = pd.value_counts(pr_list)
-
attr =count_pr.index.tolist()
-
value = count_pr.tolist()
-
maap=Map("各省微信好友分布", width=1200, height=600)
-
maap.add("", attr, value, maptype=‘china‘, is_visualmap=True,visual_text_color=‘#000‘, is_label_show = True)
-
maap.show_config()
-
maap.render(r‘wxpr.html‘)
-
print(1)