------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#将一分钟时间序列转换成3分钟, index=pd. date_range('2021-1-1', periods=9, freq='T') s=pd.Series (data=range (9), index=index) #产生3分钟的序列, #s. resample (rule=' 3T', how='sum') #这种方式施错误的 s.resample(rule='3T').sum()
2021-01-01 00:00:00 3
2021-01-01 00:03:00 12
2021-01-01 00:06:00 21
Freq: 3T, dtype: int64