该
base关键字可以做的伎俩(见文档):
s.resample('24h', base=5)
例如:
In [35]: idx = pd.date_range('2012-01-01 00:00:00', freq='5min', periods=24*12*3)In [36]: s = pd.Series(np.arange(len(idx)), index=idx)In [38]: s.resample('24h', base=5)Out[38]: 2011-12-31 05:00:00 29.52012-01-01 05:00:00 203.52012-01-02 05:00:00 491.52012-01-03 05:00:00 749.5Freq: 24H, dtype: float64
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)