我试图从15分钟到每周重新采样时间序列数据。但这无法解决问题,我阅读了文档和许多相关问题,但听不懂。我的代码如下import numpy as npimport matplotlib.pyplot as pltimport pandas as pdimport seaborn as sns%matplotlib inlineWind = pd.read_csv('C:\WindData.csv')Wind = Wind.dropna(axis=0, how='any', thresh=None, subset=None, inplace=False) #Drop the nanWind.index = pd.to_datetime(Wind['Date'])Wind_Weekly = Wind['Date'].resample('W').sum()原始数据如下所示Date Actual Forecast Demand0 01/01/2017 00:00 1049 1011.0 2922 1 01/01/2017 00:15 961 1029.0 2892 2 01/01/2017 00:30 924 1048.0 2858 3 01/01/2017 00:45 852 1066.0 2745 重新采样后,数据变成这样Date2017-01-01 01/01/2017 00:0001/01/2017 00:1501/01/2017 00:...2017-01-08 01/02/2017 00:0001/02/2017 00:1501/02/2017 00:...2017-01-15 01/09/2017 00:0001/09/2017 00:1501/09/2017 00:...2017-01-22 16/01/2017 00:0016/01/2017 00:1516/01/2017 00:...我只想每周分别汇总“实际”,“预测”和“需求”,您知道我做错了吗?
添加回答
举报
0/150
提交
取消