0
我試圖插入一個非常大的CSV文件到InfluxDB和我將它看作在Python:麻煩插入數據幀進入InfluxDB使用Python
influx_pd = influxdb.DataFrameClient(host, port, user, password, db, verify_ssl=False)
for frame in pd.read_csv(infile, chunksize=batch_count):
frame.set_index(pd.DatetimeIndex(frame[date_pk]), inplace=True)
frame.dropna(axis=1, how='all')
influx_pd.write_points(frame, 'patients')
然而,在第一次調用write_points,我M個接收這個錯誤(截斷):
raise InfluxDBClientError(response.content, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"unable to parse 'enroll_pd Pt Id=\"21.0\",Admit Date=\"2010-12-05\", ... MRSA Screening=\"Negative\" 1291507200000000000': invalid field format\nunable to parse ... (ellipses used to truncate)
我曾讀過關於與InfluxDB和NaN值(其中我的CSV文件中確實含有)的問題,所以我試圖插入佔位符值NaN值,但得到相同的結果。有人可以幫我找到我的代碼中的問題?這將非常感激。
我使用InfluxDB 1.3 Docker鏡像僅供參考。