import pandas as pd index=pd.date_range('2020-1-1',periods=2) s=pd.Series(range(1,3),index=index) #升采样 #s.resample('6H').asfreq() #使用前值填充 #s.resample('6H').ffill() #使用后值填充 s.resample('6H').bfill()
2020-01-01 00:00:00 1 2020-01-01 06:00:00 2 2020-01-01 12:00:00 2 2020-01-01 18:00:00 2 2020-01-02 00:00:00 2 Freq: 6H, dtype: int64
标签:采样,index,00,01,处理,6H,64,pd,2020 From: https://www.cnblogs.com/988MQ/p/16929471.html