Commit 6dcd4a36 authored by Forquet Nicolas's avatar Forquet Nicolas

the append_and_save function has been modified because it is not possible to...

the append_and_save function has been modified because it is not possible to use the feather binary format on an arm architecture. Move to a simple csv file for saving #5
parent c1c46552
......@@ -18,7 +18,6 @@ import sys
import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn
import pandas as pd
import feather
from pathlib import Path
"""
......@@ -135,12 +134,12 @@ def append_and_save(path, last_measurement):
if path.is_file():
# Load data file and append data to it
df = feather.read_dataframe(path)
df.append(last_measurement)
feather.write_dataframe(df, path)
with open(path, 'a') as f:
last_measurement.to_csv(f, header=False)
else:
# create data file
feather.write_dataframe(last_measurement, path)
# create data file and add headers
with open(path, 'a') as f:
last_measurement.to_csv(f, header=True)
"""
Initialization of GPIO channels
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment