From cd85989dbe4dd0bd734dadc197bbcd7ba8fd1767 Mon Sep 17 00:00:00 2001 From: Rousseau Vincent <vincent.rousseau@irstea.fr> Date: Fri, 4 Jan 2019 13:04:32 +0100 Subject: [PATCH] add read csv script --- read_csv.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 read_csv.py diff --git a/read_csv.py b/read_csv.py new file mode 100644 index 0000000..b135aa2 --- /dev/null +++ b/read_csv.py @@ -0,0 +1,22 @@ +import csv +import matplotlib.pyplot as plt +from scipy import signal + +with open('sense_hat_data_2019_01_04_00_00.csv') as f: + datas = csv.reader(f) + header = next(datas) + temp = [] + time = [] + for row in datas: + time.append(float(row[0])) + temp.append(float(row[2])) + +print(temp) + +temp_decimate = signal.decimate(temp, 10, 3, zero_phase=True) +print(temp_decimate) + +plt.plot(time,temp) +plt.show() + + -- GitLab