#看哪个网站对各大战区贡献总业绩最多
qd_pdf_eachnet=qd_pdf_eachnet.rename(columns={'区董':'成交区董'})
qd_df_eachnet=pd.concat([qd_cdf_eachnet,qd_pdf_eachnet],join='outer',\
ignore_index=True).groupby(['成交区董','成交网站']).\
agg({'单数(拆分)':sum,'业绩(拆分)':sum}).\
reset_index()
qd_df_eachnet=qd_df_eachnet[qd_df_eachnet.成交网站.\
isin(['58同城', '中原网', '安居客', '搜房网'])]
qd_df_wb=qd_df_eachnet[qd_df_eachnet.成交网站=='58同城'].\
rename(columns={'单数(拆分)':'58同城单数(拆分)','业绩(拆分)':'58同城业绩(拆分)'})
qd_df_aj=qd_df_eachnet[qd_df_eachnet.成交网站=='安居客'].\
rename(columns={'单数(拆分)':'安居客单数(拆分)','业绩(拆分)':'安居客业绩(拆分)'})
qd_df_zy=qd_df_eachnet[qd_df_eachnet.成交网站=='中原网'].\
rename(columns={'单数(拆分)':'中原网单数(拆分)','业绩(拆分)':'中原网业绩(拆分)'})
qd_df_sf=qd_df_eachnet[qd_df_eachnet.成交网站=='搜房网'].\
rename(columns={'单数(拆分)':'搜房网单数(拆分)','业绩(拆分)':'搜房网业绩(拆分)'})
df1=pd.merge(left=qd_df_wb[['成交区董',\
'58同城单数(拆分)','58同城业绩(拆分)']],\
right=qd_df_aj[['成交区董','安居客单数(拆分)','安居客业绩(拆分)']],\
left_on='成交区董',right_on='成交区董',how='outer').fillna(0)
df2=pd.merge(left=qd_df_zy[['成交区董',\
'中原网单数(拆分)','中原网业绩(拆分)']],\
right=qd_df_sf[['成交区董','搜房网单数(拆分)','搜房网业绩(拆分)']],\
left_on='成交区董',right_on='成交区董',how='outer').fillna(0)
qd_df_all=pd.merge(left=df1,right=df2,\
left_on='成交区董',right_on='成交区董',how='outer').fillna(0)
#排序
qd_df_all['总单数']=qd_df_all['中原网单数(拆分)']+qd_df_all['安居客单数(拆分)']\
+qd_df_all['搜房网单数(拆分)']+qd_df_all['58同城单数(拆分)']
qd_df_all['总业绩']=qd_df_all['中原网业绩(拆分)']+qd_df_all['安居客业绩(拆分)']\
+qd_df_all['搜房网业绩(拆分)']+qd_df_all['58同城业绩(拆分)']
#画图
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['axes.unicode_minus']=False
matplotlib.rcParams['font.sans-serif']=['SimHei']
qd_df_all=qd_df_all.set_index('成交区董')
#画单数
qd_df_all=qd_df_all.sort_values(by='总业绩',ascending=False)
plt.figure(figsize=(16,6.5),dpi=300)
plt.subplot(211)
plt.title('2019年'+str(noww.month-1)+'月-大战区分网络总单数与总业绩',fontsize=16)
plt.bar(range(len(qd_df_all.index)),qd_df_all['中原网单数(拆分)'],\
bottom=0,color='crimson',label='中原网单数(拆分)')
plt.bar(range(len(qd_df_all.index)),qd_df_all['安居客单数(拆分)'],\
bottom=qd_df_all['中原网单数(拆分)'],color='royalblue',label='安居客单数(拆分)')
plt.bar(range(len(qd_df_all.index)),qd_df_all['搜房网单数(拆分)'],\
bottom=qd_df_all['中原网单数(拆分)']+qd_df_all['安居客单数(拆分)'],\
color='cyan',label='搜房网单数(拆分)')
plt.bar(range(len(qd_df_all.index)),qd_df_all['58同城单数(拆分)'],\
bottom=qd_df_all['中原网单数(拆分)']+qd_df_all['安居客单数(拆分)']\
+qd_df_all['搜房网单数(拆分)'],color='darkgreen',label='58同城单数(拆分)')
plt.xticks(ticks=range(len(qd_df_all.index)),labels=qd_df_all.index,fontsize=12)
plt.legend(loc='upper right')
for x,y in zip(range(len(qd_df_all.index)),qd_df_all['中原网单数(拆分)']):
plt.text(x,y*0.5,str(round(y,2)),va='center',ha='center')
#画业绩
plt.subplot(212)
plt.bar(range(len(qd_df_all.index)),qd_df_all['中原网业绩(拆分)'],
bottom=0,color='crimson',label='中原网业绩(拆分)(万)')
plt.bar(range(len(qd_df_all.index)),qd_df_all['安居客业绩(拆分)'],
bottom=qd_df_all['中原网业绩(拆分)'],color='royalblue',label='安居客业绩(拆分)(万)')
plt.bar(range(len(qd_df_all.index)),qd_df_all['搜房网业绩(拆分)'],
bottom=qd_df_all['中原网业绩(拆分)']+qd_df_all['安居客业绩(拆分)'],
color='cyan',label='搜房网业绩(拆分)(万)')
plt.bar(range(len(qd_df_all.index)),qd_df_all['58同城业绩(拆分)'],
bottom=qd_df_all['中原网业绩(拆分)']+qd_df_all['安居客业绩(拆分)']
+qd_df_all['搜房网业绩(拆分)'],color='darkgreen',label='58同城业绩(拆分)(万)')
plt.xticks(ticks=range(len(qd_df_all.index)),labels=qd_df_all.index,fontsize=12)
plt.legend(loc='upper right')
for x,y in zip(range(len(qd_df_all.index)),qd_df_all['中原网业绩(拆分)']):
plt.text(x,y*0.5,str(int(y/10000)),va='center',ha='center')
plt.show()
'''#2.8.分区董CTM买卖与租赁最大单'''
qdeal_ctm_top_s=qdeal_ctm[qdeal_ctm.成交类型=='买卖']\
[['Root Id','成交区董','成交类型','CTM业绩','成交金额','楼盘名称','案件时间']].\
drop_duplicates().sort_values(by=['成交区董','CTM业绩'],ascending=[False,False]).\
groupby('成交区董')[['成交区董','楼盘名称','CTM业绩','成交金额','成交类型','案件时间']]\
.head(1).sort_values(by='CTM业绩',ascending=False)
qdeal_ctm_top_s.to_excel(r'd:\Users\zhanggl21\Desktop\qdeal_ctm_top_s.xlsx')
qdeal_ctm_top_r=qdeal_ctm[qdeal_ctm.成交类型=='租赁']\
[['Root Id','成交区董','成交类型','CTM业绩','成交金额','楼盘名称','案件时间']].\
drop_duplicates().sort_values(by=['成交区董','CTM业绩'],ascending=[False,False]).\
groupby('成交区董')[['成交区董','楼盘名称','CTM业绩','成交金额','成交类型','案件时间']]\
.head(1).sort_values(by='CTM业绩',ascending=False)
qdeal_ctm_top_r.to_excel(r'd:\Users\zhanggl21\Desktop\qdeal_ctm_top_r.xlsx')
'''#2.9.分区董PTM最大单'''
qdeal_ptm_top=ptmdeal\
[['成交编号','成交区董','交易类型','计佣金额','总价','物业名称','成交时间']].\
drop_duplicates().sort_values(by=['成交区董','计佣金额'],ascending=[False,False]).\
groupby('成交区董')[['成交区董','物业名称','计佣金额','总价','交易类型','成交时间']]\
.head(1).sort_values(by='计佣金额',ascending=False)
qdeal_ptm_top[qdeal_ptm_top.成交区董.isin(qd_lst)].\
to_excel(r'd:\Users\zhanggl21\Desktop\qdeal_ptm_top.xlsx')
'''##########三.分网站/渠道成交情况'''
'''#3.1.电话直聊委托(月度业绩(拆分)分布)--占比'''
dzw_df_p=pd.read_excel('E:\\暂存\\月度成交分析报告\\Datasets\\'
'2.中原网电话直聊委托成交\\中原网电话直聊委托成交总结.xlsx',\
sheet_name='比例')
dzw_df_p=dzw_df_p.set_index('月份')['2019-01-01':]
dh_df_p=dzw_df_p[dzw_df_p.来电来源=='电话'].sort_index()
wt_df_p=dzw_df_p[dzw_df_p.来电来源=='在线委托'].sort_index()
zl_df_p=dzw_df_p[dzw_df_p.来电来源=='直聊'].sort_index()
#画图
plt.figure(figsize=(16,6.5),dpi=300)
plt.subplot(311)
plt.bar(range(len(dh_df_p.index)),dh_df_p.占当月中原网总体业绩比例,bottom=0,\
color='dodgerblue',alpha=0.5,label='电话占中原网总业绩')
plt.bar(range(len(dh_df_p.index)),wt_df_p.占当月中原网总体业绩比例,\
bottom=dh_df_p.占当月中原网总体业绩比例,\
color='lightcoral',label='委托占中原网总业绩')
plt.bar(range(len(dh_df_p.index)),zl_df_p.占当月中原网总体业绩比例,\
bottom=dh_df_p.占当月中原网总体业绩比例+wt_df_p.占当月中原网总体业绩比例,\
color='deepskyblue',label='直聊占中原网总业绩')
import datetime
plt.xticks(ticks=range(len(dh_df_p.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in dh_df_p.index],\
weight='bold',fontsize=10)
plt.ylim([0,1.8])
plt.title(label='电话委托直聊-占中原网业绩(总/ctm/ptm)比例',\
fontsize=12,fontweight='bold')
plt.legend(loc='upper left',fontsize=8)
for x,y in zip(range(len(dh_df_p)),dh_df_p.占当月中原网总体业绩比例):
plt.text(x,y*0.5,s='%.2f%%' %(y*100),va='center',ha='center',fontsize=8)
for x,y,z in zip(range(len(dh_df_p)),wt_df_p.占当月中原网总体业绩比例,\
dh_df_p.占当月中原网总体业绩比例):
plt.text(x,(y+z)*0.85,s='%.2f%%' %(y*100),va='center',ha='center',fontsize=8)
for x,y,z,w in zip(range(len(dh_df_p)),zl_df_p.占当月中原网总体业绩比例,\
wt_df_p.占当月中原网总体业绩比例,\
dh_df_p.占当月中原网总体业绩比例):
plt.text(x,(y+z+w)*0.75,s='%.2f%%' %(y*100),va='center',ha='center',fontsize=8)
plt.subplot(312)
plt.bar(range(len(dh_df_p.index)),dh_df_p.占当月中原网ctm业绩比例,bottom=0,
color='dodgerblue',alpha=0.5,label='电话占中原网ctm总业绩')
plt.bar(range(len(dh_df_p.index)),wt_df_p.占当月中原网ctm业绩比例,
bottom=dh_df_p.占当月中原网ctm业绩比例,
color='lightcoral',label='委托占中原网ctm总业绩')
plt.bar(range(len(dh_df_p.index)),zl_df_p.占当月中原网ctm业绩比例,
bottom=dh_df_p.占当月中原网ctm业绩比例+wt_df_p.占当月中原网ctm业绩比例,
color='deepskyblue',label='直聊占中原网ctm总业绩')
import datetime
plt.xticks(ticks=range(len(dh_df_p.index)),
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in dh_df_p.index],
weight='bold',fontsize=10)
plt.ylim([0,1.8])
plt.legend(loc='upper left',fontsize=8)
for x,y in zip(range(len(dh_df_p)),dh_df_p.占当月中原网ctm业绩比例):
plt.text(x,y*0.5,s='%.2f%%' %(y*100),va='center',ha='center',fontsize=8)
for x,y,z in zip(range(len(dh_df_p)),wt_df_p.占当月中原网ctm业绩比例,
dh_df_p.占当月中原网ctm业绩比例):
plt.text(x,(y+z)*0.85,s='%.2f%%' %(y*100),va='center',ha='center',fontsize=8)
for x,y,z,w in zip(range(len(dh_df_p)),zl_df_p.占当月中原网ctm业绩比例,
wt_df_p.占当月中原网ctm业绩比例,
dh_df_p.占当月中原网ctm业绩比例):
plt.text(x,(y+z+w)*0.75,s='%.2f%%' %(y*100),va='center',ha='center',fontsize=8)
plt.subplot(313)
plt.bar(range(len(dh_df_p.index)),dh_df_p.占当月中原网ptm业绩比例,bottom=0,
color='dodgerblue',alpha=0.5,label='电话占中原网ptm总业绩')
plt.bar(range(len(dh_df_p.index)),wt_df_p.占当月中原网ptm业绩比例,
bottom=dh_df_p.占当月中原网ptm业绩比例,
color='lightcoral',label='委托占中原网ptm总业绩')
plt.bar(range(len(dh_df_p.index)),zl_df_p.占当月中原网ptm业绩比例,
bottom=dh_df_p.占当月中原网ptm业绩比例+wt_df_p.占当月中原网ptm业绩比例,
color='deepskyblue',label='直聊占中原网ptm总业绩')
import datetime
plt.xticks(ticks=range(len(dh_df_p.index)),
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in dh_df_p.index],
weight='bold',fontsize=10)
plt.ylim([0,1.8])
plt.legend(loc='upper left',fontsize=8)
for x,y in zip(range(len(dh_df_p)),dh_df_p.占当月中原网ptm业绩比例):
plt.text(x,y*0.5,s='%.2f%%' %(y*100),va='center',ha='center',fontsize=8)
for x,y,z in zip(range(len(dh_df_p)),wt_df_p.占当月中原网ptm业绩比例,
dh_df_p.占当月中原网ptm业绩比例):
plt.text(x,(y+z)*0.85,s='%.2f%%' %(y*100),va='center',ha='center',fontsize=8)
for x,y,z,w in zip(range(len(dh_df_p)),zl_df_p.占当月中原网ptm业绩比例,
wt_df_p.占当月中原网ptm业绩比例,
dh_df_p.占当月中原网ptm业绩比例):
plt.text(x,(y+z+w)*0.95,s='%.2f%%' %(y*100),va='center',ha='center',fontsize=8)
plt.show()
'''#3.2.画中原网、安居客、搜房、五八同城一二手单数走势图'''
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.sans-serif']=['SimHei']
matplotlib.rcParams['axes.unicode_minus']=False
plt.figure(figsize=(16,6.5),dpi=300)
plt.subplot(411)
plt.bar(range(len(netp_zy.index)),netp_zy.CTM单数,\
bottom=0,color='dodgerblue',alpha=0.5,label='中原网CTM单数')
plt.bar(range(len(netp_zy.index)),netp_zy.PTM单数,\
bottom=netp_zy.CTM单数,color='deepskyblue',label='中原网PTM单数')
for x,y in zip(range(len(netp_zy.index)),netp_zy.总单数):
plt.text(x,y+20,str(round(y,2)),va='center',ha='center',fontsize=10)
plt.xticks(ticks=range(len(netp_zy.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,601,100),labels=[str(x) for x in range(0,501,100)])
plt.title('2019年'+str(noww.month-1)+'月-中原网及合作网站拆分单数',fontsize=12)
plt.legend(loc='upper left',fontsize=10)
plt.subplot(412)
plt.bar(range(len(netp_aj.index)),netp_aj.CTM单数,\
bottom=0,color='dodgerblue',alpha=0.5,label='安居客CTM单数')
plt.bar(range(len(netp_aj.index)),netp_aj.PTM单数,\
bottom=netp_aj.CTM单数,color='deepskyblue',label='安居客PTM单数')
for x,y in zip(range(len(netp_aj.index)),netp_aj.总单数):
plt.text(x,y+20,str(round(y,2)),va='center',ha='center',fontsize=10)
plt.xticks(ticks=range(len(netp_aj.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,601,100),labels=[str(x) for x in range(0,501,100)])
plt.legend(loc='upper left',fontsize=10)
plt.subplot(413)
plt.bar(range(len(netp_sf.index)),netp_sf.CTM单数,\
bottom=0,color='dodgerblue',alpha=0.5,label='搜房网CTM单数')
plt.bar(range(len(netp_sf.index)),netp_sf.PTM单数,\
bottom=netp_sf.CTM单数,color='deepskyblue',label='搜房网PTM单数')
for x,y in zip(range(len(netp_sf.index)),netp_sf.总单数):
plt.text(x,y+20,str(round(y,2)),va='center',ha='center',fontsize=10)
plt.xticks(ticks=range(len(netp_sf.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,501,100),labels=[str(x) for x in range(0,501,100)])
plt.legend(loc='upper left',fontsize=10)
plt.subplot(414)
plt.bar(range(len(netp_wb.index)),netp_wb.CTM单数,\
bottom=0,color='dodgerblue',alpha=0.5,label='五八同城CTM单数')
plt.bar(range(len(netp_wb.index)),netp_wb.PTM单数,\
bottom=netp_wb.CTM单数,color='deepskyblue',label='五八同城PTM单数')
for x,y in zip(range(len(netp_wb.index)),netp_wb.总单数):
plt.text(x,y+20,str(round(y,2)),va='center',ha='center',fontsize=10)
plt.xticks(ticks=range(len(netp_wb.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,501,100),labels=[str(x) for x in range(0,501,100)])
plt.legend(loc='upper left',fontsize=10)
plt.show()
'''#3.3画中原网、安居客、搜房、五八同城一二手业绩走势图'''
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.sans-serif']=['SimHei']
matplotlib.rcParams['axes.unicode_minus']=False
plt.figure(figsize=(16,6.5),dpi=300)
plt.subplot(411)
plt.bar(range(len(netp_zy.index)),netp_zy.CTM业绩,\
bottom=0,color='dodgerblue',alpha=0.5,label='中原网CTM业绩')
plt.bar(range(len(netp_zy.index)),netp_zy.PTM业绩,\
bottom=netp_zy.CTM业绩,color='deepskyblue',label='中原网PTM业绩')
for x,y in zip(range(len(netp_zy.index)),netp_zy.总业绩):
plt.text(x,y*1.1,'{:,}'.format(round(y)),va='center',ha='center',fontsize=10)
plt.xticks(ticks=range(len(netp_zy.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,30000001,5000000),\
labels=[str(int(x/10000))+'万' for x in range(0,30000000,5000000)])
plt.title('2019年'+str(noww.month-1)+'月-中原网及合作网站拆分业绩',fontsize=12)
plt.legend(loc='upper left',fontsize=10)
plt.subplot(412)
plt.bar(range(len(netp_aj.index)),netp_aj.CTM业绩,\
bottom=0,color='dodgerblue',alpha=0.5,label='安居客CTM业绩')
plt.bar(range(len(netp_aj.index)),netp_aj.PTM业绩,\
bottom=netp_aj.CTM业绩,color='deepskyblue',label='安居客PTM业绩')
for x,y in zip(range(len(netp_aj.index)),netp_aj.总业绩):
plt.text(x,y*1.1,'{:,}'.format(round(y)),va='center',ha='center',fontsize=10)
plt.xticks(ticks=range(len(netp_aj.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,30000001,5000000),\
labels=[str(int(x/10000))+'万' for x in range(0,30000000,5000000)])
plt.legend(loc='upper left',fontsize=10)
plt.subplot(413)
plt.bar(range(len(netp_sf.index)),netp_sf.CTM业绩,\
bottom=0,color='dodgerblue',alpha=0.5,label='搜房网CTM业绩')
plt.bar(range(len(netp_sf.index)),netp_sf.PTM业绩,\
bottom=netp_sf.CTM业绩,color='deepskyblue',label='搜房网PTM业绩')
for x,y in zip(range(len(netp_sf.index)),netp_sf.总业绩):
plt.text(x,y+500000,'{:,}'.format(round(y)),va='center',ha='center',fontsize=10)
plt.xticks(ticks=range(len(netp_sf.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,10000000,2000000),\
labels=[str(int(x/10000))+'万' for x in range(0,10000000,2000000)])
plt.legend(loc='upper left',fontsize=10)
plt.subplot(414)
plt.bar(range(len(netp_wb.index)),netp_wb.CTM业绩,\
bottom=0,color='dodgerblue',alpha=0.5,label='五八同城CTM业绩')
plt.bar(range(len(netp_wb.index)),netp_wb.PTM业绩,\
bottom=netp_wb.CTM业绩,color='deepskyblue',label='五八同城PTM业绩')
for x,y in zip(range(len(netp_wb.index)),netp_wb.总业绩):
plt.text(x,y+500000,'{:,}'.format(round(y)),va='center',ha='center',fontsize=10)
plt.xticks(ticks=range(len(netp_wb.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,10000000,2000000),\
labels=[str(int(x/10000))+'万' for x in range(0,10000000,2000000)])
plt.legend(loc='upper left',fontsize=10)
plt.show()
'''#3.4渠道成交单数及业绩'''
import pandas as pd
qd_df=pd.read_excel('E:\\暂存\\月度成交分析报告\\Datasets\\'
'4.分网站渠道成交情况\\分渠道成交情况.xlsx')
ali_df=qd_df[['月份','支付宝租房ctm单数','支付宝租房ctm业绩',\
'支付宝租房ptm单数','支付宝租房ptm业绩']].set_index(['月份']).sort_index()
fx_df=qd_df[['月份','一手分销ctm单数','一手分销ctm业绩',\
'一手分销ptm单数','一手分销ptm业绩']].set_index(['月份']).sort_index()
wy_df=qd_df[['月份','我要房产ctm单数','我要房产ctm业绩',\
'我要房产ptm单数','我要房产ptm业绩']].set_index(['月份']).sort_index()
fdd_df=qd_df[['月份','房多多ctm单数','房多多ctm业绩',\
'房多多ptm单数','房多多ptm业绩']].set_index(['月份']).sort_index()
#画支付宝租房的单数与业绩
#增加'总单数'和'总业绩两列'
ali_df['总单数']=ali_df.支付宝租房ctm单数+ali_df.支付宝租房ptm单数
ali_df['总业绩']=ali_df.支付宝租房ctm业绩+ali_df.支付宝租房ptm业绩
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.sans-serif']=['SimHei']
matplotlib.rcParams['axes.unicode_minus']=False
plt.figure(figsize=(16,6.5),dpi=300)
plt.subplot(211)
plt.bar(range(len(ali_df.index)),ali_df.支付宝租房ctm单数,\
color='dodgerblue',alpha=0.5,bottom=0,label='支付宝租房ctm单数')
plt.bar(range(len(ali_df.index)),ali_df.支付宝租房ptm单数,\
color='deepskyblue',bottom=ali_df.支付宝租房ctm单数,label='支付宝租房ptm单数')
plt.xticks(ticks=range(len(ali_df.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,20,5))
plt.legend(loc='upper left')
for x,y in zip(range(len(ali_df.index)),ali_df.总单数):
plt.text(x,y+1,int(y),va='center',ha='center',fontsize=10)
plt.ylabel('单数')
plt.title('支付宝租房单数与业绩',fontsize=12)
plt.subplot(212)
plt.bar(range(len(ali_df.index)),ali_df.支付宝租房ctm业绩,\
color='dodgerblue',alpha=0.5,bottom=0,label='支付宝租房ctm业绩')
plt.bar(range(len(ali_df.index)),ali_df.支付宝租房ptm业绩,\
color='deepskyblue',bottom=ali_df.支付宝租房ctm业绩,label='支付宝租房ptm业绩')
plt.xticks(ticks=range(len(ali_df.index)),\
labels=[str(d1.year)+'年'+str(d1.month)+'月' for d1 in netp_zy.index],\
fontsize=10)
plt.yticks(ticks=range(0,100001,20000))
plt.legend(loc='upper left',fontsize=10)
for x,y in zip(range(len(ali_df.index)),ali_df.总业绩):
plt.text(x,y+3000,int(y),va='center',ha='center',fontsize=10)
plt.xlabel('月份')
plt.ylabel('业绩')
plt.show()