Pandas timeseries resampling and interpolating together

天大地大妈咪最大 提交于 2019-11-30 23:40:58
piRSquared
d = df.set_index('tstamp')
t = d.index
r = pd.date_range(t.min().date(), periods=24*60, freq='T')

d.reindex(t.union(r)).interpolate('index').ix[r]


Note, periods=24*60 works on daily data, not on the sample provided in the question. For that sample, periods=6 will work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!