Skip to content
Snippets Groups Projects
Commit 244c1ec7 authored by Samuel Schmidt's avatar Samuel Schmidt
Browse files

float instead strings

parent d3b0e04a
No related branches found
No related tags found
No related merge requests found
......@@ -19,8 +19,8 @@ with open(inpath, 'r') as myfile:
for x in myfile:
data = x.split(",")
date = data[0]
temperature = data[1]
humidity = data[2]
temperature = round(float(data[1]), 2)
humidity = round(float(data[2]), 2)
dates.append(datetime.datetime.strptime(date, "%d_%m_%Y_%H_%M_%S_%f"))
temperatures.append(temperature)
......@@ -29,4 +29,5 @@ with open(inpath, 'r') as myfile:
timestamps = [(dates[i]-dates[0]).total_seconds() for i in range(len(dates))]
plt.plot(timestamps, temperatures)
plt.plot(timestamps, humiditys)
plt.legend(["Temperatur", "Relative Luftfeuchte"])
plt.show()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment