小编Tim*_*Tim的帖子

Python - 快速HDF5时间序列数据查询

我需要在HDF5数据库的特定时间范围内对时间序列数据进行大量连续查询(数据是以秒为单位的stord,并不总是"连续",我只知道开始和结束时间).因此,我想知道有一个比我现在的代码更快的解决方案,这是受这个答案的启发:

import pandas as pd
from pandas import HDFStore

store = HDFStore(pathToStore)
dates = pd.date_range(start=start_date,end=end_date, freq='S')
index = store.select_column('XAU','index')
ts    = store.select('XAU', where=index[index.isin(dates)].index)
Run Code Online (Sandbox Code Playgroud)

任何意见和建议都非常感谢,谢谢!

time-series hdf5 python-3.x pandas

2
推荐指数
1
解决办法
2494
查看次数

标签 统计

hdf5 ×1

pandas ×1

python-3.x ×1

time-series ×1