|
ts=pd.Series(np.arange(12),index=ts_index)
>>> ts
2017-06-20 00:00:00 0
2017-06-20 00:01:00 1
2017-06-20 00:02:00 2
2017-06-20 00:03:00 3
2017-06-20 00:04:00 4
2017-06-20 00:05:00 5
2017-06-20 00:06:00 6
2017-06-20 00:07:00 7
2017-06-20 00:08:00 8
2017-06-20 00:09:00 9
2017-06-20 00:10:00 10
2017-06-20 00:11:00 11
Freq: T, dtype: int32
>>> ts.resample('5min',how='sum')
Warning (from warnings module):
File "__main__", line 1
FutureWarning: how in .resample() is deprecated
the new syntax is .resample(...).sum()
2017-06-20 00:00:00 10
2017-06-20 00:05:00 35
2017-06-20 00:10:00 21
Freq: 5T, dtype: int32
重新采样 由于使用的how='sum' ,这不是加吗?为什么采样出来的值是10、35、21呢
|
|