csv_to_influx.py : replace 'NaN' with '0' , NaN not accepted

Not a Number by influx.

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-07-17 16:30:47 -06:00
parent 5fb7d9569e
commit 8bb4e74b77

View File

@@ -57,6 +57,8 @@ class CSVtoInflux():
# Submit data to the influx db if configured to do so.
def post_to_influx(self):
df = self.read_csv(self.target_csv)
for row in df:
row =[sub.replace('NaN','0') for sub in row]
length = list(range(0, len(df[0])))
columns = dict(zip(df[0], length))
print('columns: %s' % columns)