Hi there,
Having a bit of challenge ingesting data into influxdb v2. My data is in a data frame and I keep getting this error (TypeError: cannot convert the series to <class ‘float’>).
This is a view of my data
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 500 entries, 0 to 499
Data columns (total 6 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 timestamp 500 non-null int64
1 open 500 non-null float64
2 high 500 non-null float64
3 low 500 non-null float64
4 close 500 non-null float64
5 volume 500 non-null float64
dtypes: float64(5), int64(1)
memory usage: 23.6 KB
I created a Point object as follows
def parse_data(df):
return Point("crypto_ohlcv") \
.tag("exchange", "binance") \
.field("open", df['open'].astype(float)) \
.field("high", df['high'].astype(float)) \
.field("low", df['low'].astype(float)) \
.field("close", df['close'].astype(float)) \
.field("volume", df['volume'].astype(float))\
.time(df.timestamp)
and trying to injest the data as follows
write_api.write(bucket=bucket, org=org, record=parse_data(data))
Any suggestions on what could be the issue will be helpful