From 8bb4e74b776ce161fc1489422e3c6b8c5f21c465 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Sat, 17 Jul 2021 16:30:47 -0600 Subject: [PATCH] csv_to_influx.py : replace 'NaN' with '0' , NaN not accepted Not a Number by influx. Signed-off-by: Chuck SmileyRekiere --- py-scripts/csv_to_influx.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-scripts/csv_to_influx.py b/py-scripts/csv_to_influx.py index 8c126b0d..b0056a82 100755 --- a/py-scripts/csv_to_influx.py +++ b/py-scripts/csv_to_influx.py @@ -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)