【发布时间】:2023-03-18 07:53:01
【问题描述】:
我刚开始在 python 中使用 influxdb 客户端。我正在尝试将 Dataframe 写入 influxdb。基于
https://influxdb-python.readthedocs.io/en/latest/examples.html#tutorials-pandas
我可以使用 DataFrameClient 来做到这一点。
我的数据:
Val1 Val2 S_id Formula
Date
2020-01-01 01:00:00+00:00 26.131181 12.537605 35211 soneja
2020-01-01 01:15:00+00:00 21.459827 10.671435 35211 soneja
... ... ... ... ...
2020-01-21 00:45:00+00:00 13.257205 4.322372 35211 soneja
2020-01-21 01:00:00+00:00 13.520987 4.393989 35211 soneja
1901 rows × 4 columns
我将数据发送到 influxdb 的代码:
from influxdb import DataFrameClient
client = DataFrameClient(host, port, user, password, dbname)
client.write_points(df, dbname, protocol='line')
我得到的错误:
('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
【问题讨论】: