import os import pandas as pd import matplotlib.pyplot as plt name=['单号','销售日期','商品编码','商品名称','车型','仓位','销售数量','销售单价','销售金额'] os.chdir('e:') df1=pd.read_excel('./zyxiaoshou.xlsx',sheetname='Sheet5',header=0,names=name)
import os import pandas as pd import matplotlib.pyplot as plt name=['单号','销售日期','商品编码','商品名称','车型','仓位','销售数量','销售单价','销售金额'] os.chdir('e:') df=[] for i in range(1,13): df.append(pd.read_excel('./zyxiaoshou.xlsx',sheetname='Sheet'+str(i),header=0,names=name)) data=pd.concat(df) data.index=[data['销售日期']]
t1.sum(axis=1).plot(figsize=(10,3),rot=45,style='bo-') plt.grid(True) plt.title('总体销售') plt.ylabel('销售金额') plt.xlabel('销售月份') for i in range(len(t1)): plt.annotate(t1.sum(axis=1).values[i], xy=(t1.index[i],t1.sum(axis=1)[i]), xytext=(t1.index[i],t1.sum(axis=1)[i]) ) plt.show()
import os import pandas as pd import matplotlib.pyplot as plt name=['单号','销售日期','商品编码','商品名称','车型','仓位','销售数量','销售单价','销售金额'] os.chdir('e:') df=[] for i in range(1,12): df.append(pd.read_excel('./zyxiaoshou.xlsx',sheetname='Sheet'+str(i),header=0,names=name)) data=pd.concat(df) data.to_excel('./zyqp.xls')