What exactly should be the parameters of write_points in the python DataFrameClient?

I’m trying to wrap my head around the DataFrameClient.
What I have are pandas dataframes where each row represents a timestamp and each column represents a metric (something like “facility_name.section_name.subsection_name.device_name.measurement”).
I would like to write these into influxdb. I tried using DataFrameClient but I’m getting errors (specifically the latest one is BrokenPipeError(32, ‘Broken pipe’)).

I feel like I’m missing some understanding of the different parameters I should be giving to write_points, and I can’t find a detailed description of them anywhere. Specifically:

  1. What exactly is the “measurement” parameter and what sort of value it should be set to?
  2. Should field_columns simply be all the columns of my df, assuming each column represents a unique metric I want to write to the db?

I have installed influxdb through the docker instructions here:

Hi @CarbonFixer

I’ve informed someone on our team that has used the Pandas integration a fair bit. Hopefully she’ll have an opportunity to get back to you soon :+1:

1 Like

Hello @CarbonFixer,
Unfortunately, the client doesn’t have a pandas->influx portion yet (only influx->pandas). Please take a look at this blog and this script to see how I write my pd.DataFrame to Influx.

Thanks. So, in my case I’m still not sure what should be the measurement, tag and field, and what is the practical difference between them. All I have are timestamps and values of different metrics (which have their names formatted as, for example, “facility_name.section_name.subsection_name.device_name.measurement”).
Are all those parameters compulsory? If not, should I put an empty string in those that are not relevant?

Hello @CarbonFixer,
It’s best to store the facility_name, section_name, _subseection_name, and _device_name as tags. No, not all of those parameters are compulsory. You do need a measurement, fields, and a timestamp though.
Please take a second to learn about line protocol (v1.x docs) or (c2.x docs) and general recommendations for schema design.