基本信息
源码名称:销售收入分析与预测
源码大小:1.06M
文件格式:.zip
开发语言:Python
更新时间:2021-04-01
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 4 元×
微信扫码支付:4 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
#去除空日期和金额为0的记录 df1=df1[df1['业务日期'].notnull() & df1['金额'] !=0] df2=df2[df2['投放日期'].notnull() & df2['支出'] !=0] df1['业务日期'] = pd.to_datetime(df1['业务日期']) df2['投放日期'] = pd.to_datetime(df2['投放日期']) dfData = df1.set_index('业务日期',drop=True) dfCar=df2.set_index('投放日期',drop=True) # 按月度统计并显示销售金额 dfData_month=dfData.resample('M').sum().to_period('M') # 按月度统计并显示广告费支出金额 dfCar_month=dfCar.resample('M').sum().to_period('M') dfData_month.to_excel(resultfile1) #导出结果 dfCar_month.to_excel(resultfile2) #导出结果