influxdb-python icon indicating copy to clipboard operation
influxdb-python copied to clipboard

Writing a Dataframe to InfluxDB: ValueError

Open Karan-M-Shah opened this issue 5 years ago • 8 comments

I'm trying to write a simple dataframe into influx:

Index Tag 1 Field 1 Field 2

I have checked various documentation, tried a number of "solutions" but I continue to get errors.

data_frame['index'] = pd.to_datetime(data_frame['index']) data_frame = data_frame.set_index('index') client.write_points(data_frame, 'measurement', tags = { 'ID': data_frame[['ID']] })

I get the following error: ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Anyone know of a solution?

Karan-M-Shah avatar Feb 12 '20 19:02 Karan-M-Shah

@Karan-M-Shah thank you for opening this! I think we might need some help from the community to solve this. You might also try our Community Slack https://influxdata.com/slack if you haven't already.

russorat avatar Feb 13 '20 21:02 russorat

same problem here!

galgal770 avatar Feb 27 '20 15:02 galgal770

Thanks @Karan-M-Shah and @galgal770, this does seem like a bug. I'll look into this for our v5.3.1 point release!

sebito91 avatar Apr 13 '20 03:04 sebito91

Same problem here! When v5.3.1 will be available?

MatosAndre98 avatar Aug 20 '20 14:08 MatosAndre98

Hi @sebito91

Is this issue fixed? If not, can you suggest a work around on this issue, I'm also facing the same issue #866 .

shnabin avatar Nov 30 '20 18:11 shnabin

Hi i have the some issue on v5.3.1 ... any progress ?

eliohg avatar Jan 26 '22 12:01 eliohg

Did someone find a solution? I have the same problem.

martin4B avatar May 22 '22 12:05 martin4B

Did someone find a solution? I have the same problem.

I was obligated to downgrade to the previous version.

eliohg avatar May 22 '22 19:05 eliohg