使用数据分析工具
使用流行的数据分析工具分析存储在InfluxDB数据库中的时间序列数据。
pandas
使用pandas Python数据分析库来分析和可视化存储在InfluxDB集群中的时间序列数据。
...
dataframe = reader.read_pandas()
dataframe = dataframe.set_index('time')
print(dataframe.index)
resample = dataframe.resample("1H")
resample['temp'].mean()
PyArrow
使用 PyArrow 来读取和分析 InfluxDB 查询结果。
...
table = client.query(
'''SELECT *
FROM home
WHERE time >= now() - INTERVAL '90 days'
ORDER BY time'''
)
table.group_by('room').aggregate([('temp', 'mean')])