data=pd.read_csv(‘附件1：sale_info.csv’,parse_dates=[‘date_rcd’])
data[‘year’]=data.date_rcd.dt.year
data[‘month’]=data.date_rcd.dt.month
data[‘day’]=data.date_rcd.dt.day
data=pd.DataFrame(data)
data=data[data[‘year’]==2018]
data=data[((data[‘month’] <10.0)&(data[‘month’] >= 7.0))or((data[‘month’]==10.0)&(data[‘day’]==1.0))]
data.eval(‘profit=s*real_cost’,inplace=True)
data=data.groupby(‘skc’)[‘profit’].sum()
data=data.sort_values(ascending=False)
print(data)
data.to_csv(“Test_1.csv”, encoding=“utf-8-sig”, header=True, index=True)