# -*- coding: utf-8 -*-"""
Created on Tue Nov 5 20:03:42 2019
@author: Administrator
"""import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams["font.sans-serif"]=["SimHei"]#使用指定的汉字字体类型(此处为黑体)
mpl.rcParams["axes.unicode_minus"]=False
a = pd.read_excel(r'C:\Users\Administrator\Desktop\用户分类\用户多次拉起支付未付费.xlsx')
b = pd.read_excel(r'C:\Users\Administrator\Desktop\用户分类\用户多次使用未付费.xlsx')
c = pd.read_excel(r'C:\Users\Administrator\Desktop\用户分类\用户长久未登录.xlsx')
d = pd.read_excel(r'C:\Users\Administrator\Desktop\用户分类\用户只登录未操作.xlsx')
e = pd.read_excel(r'C:\Users\Administrator\Desktop\用户分类\试用过期没付费(完成任务).xlsx')
f = pd.read_excel(r'C:\Users\Administrator\Desktop\用户分类\试用过期没付费(未完成任务).xlsx')
g = pd.read_excel(r'C:\Users\Administrator\Desktop\用户分类\会员已过期未续费.xlsx')
h = pd.read_excel(r'C:\Users\Administrator\Desktop\用户分类\试用期.xlsx')
i = pd.read_excel(r'C:\Users\Administrator\Desktop\用户分类\会员有效期内.xlsx')
aa=a.iloc[:,0].size
bb=b.iloc[:,0].size
cc=c.iloc[:,0].size
dd=d.iloc[:,0].size
ee=e.iloc[:,0].size
ff=f.iloc[:,0].size
gg=g.iloc[:,0].size
hh=h.iloc[:,0].size
ii=i.iloc[:,0].size
x=[aa,bb,cc,dd]
y=[ee+ff,gg,hh,ii]
z=[ee,ff]
u=[1,2,3,4]
v=[1,2]#==========饼图===============
plt.pie(x,labels=["用户多次拉起支付未付费","用户多次使用未付费","用户长久未登录","用户只登录未操作"],autopct="%3.1f%%",colors=["red","orange","green","yellow"],shadow=True)
plt.pie(y,labels=["试用过期没付费","会员已过期未续费","试用期","会员有效期内"],autopct="%3.1f%%",colors=["red","orange","green","yellow"],shadow=True)
plt.pie(z,labels=["完成任务","未完成任务"],autopct="%3.1f%%",colors=["green","yellow"],shadow=True)#==========柱状图==============
plt.bar(u,x,align="center",color="pink",tick_label=["用户多次拉起支付未付费","用户多次使用未付费","用户长久未登录","用户只登录未操作"])
plt.bar(u,y,align="center",color="pink",tick_label=["试用过期没付费","会员已过期未续费","试用期","会员有效期内"])
plt.bar(v,z,align="center",color="pink",tick_label=["完成任务","未完成任务"])#===========词云图 1==============import pandas as pd
from wordcloud import WordCloud
import PIL.Image as Image
# pip install opencv-pythonimport cv2
data = pd.read_excel(r'C:\Users\Administrator\Desktop\近半年数据.xlsx')
a=data["招投标关键词"]
text=[]
n=0for i in a:
text.append(i)
n+=1
text=",".join(str(i)for i in text)
mask=cv2.imread(r'C:\Users\Administrator\Desktop\111.jpg')
wordcloud=WordCloud(font_path="C:/Windows/Fonts/msyh.ttc",background_color="white",mask=mask).generate(text)
image=wordcloud.to_image()#生成图片
image.show()#===========词云图 2================
b=data["招投标地区"]
text=[]
n=0for i in b:
text.append(i)
n+=1
text=",".join(str(i)for i in text)
mask=cv2.imread(r'C:\Users\Administrator\Desktop\111.jpg')
wordcloud=WordCloud(font_path="C:/Windows/Fonts/msyh.ttc",background_color="white",mask=mask).generate(text)
image=wordcloud.to_image()#生成图片
image.show()
# -*- coding: utf-8 -*-"""Created on Tue Nov 5 20:03:42 2019@author: Administrator"""import pandas as pdimport matplotlib.pyplot as pltimport matplotlib as mplmpl.rcParams["font.sans-serif"...