import pandas as pd
import numpy as np
import time
if name == 'main':
time0 = time.time()
data1 = pd.read_csv("合拼后的国内仓30天销量,不除大单2_2020-04-27_06_48_13_41171152bt.csv")
data2 = pd.read_csv("合拼后的国内仓30天销量,不除大单2_2020-04-29_06_41_18_40754752bt.csv")
data = pd.concat([data1,data2],axis=0)
data = data.groupby([data.付款日期,data.sku]).agg({"SKU销量":"sum"})
data.reset_index(inplace = True)
data = data.pivot_table(index="sku",columns="付款日期",aggfunc={"SKU销量":np.sum},margins=False,fill_value=0)
data.to_csv("销量透视.csv")
print("计算完成,用时%s秒"%(time.time()-time0))