Created
June 6, 2018 18:20
-
-
Save Julian-Nash/aeb2d05a7633cf928e24564569215f39 to your computer and use it in GitHub Desktop.
parsing temperature logger data from raspberry pi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
data_points = {} | |
with open("test_data.txt", "r") as f: | |
for line in f: | |
date, temp = line.split("|") | |
temp = temp.strip() | |
data_points.update({date: temp}) | |
date_ = [date for date in data_points.values()] | |
temp_ = [temp for temp in data_points.keys()] | |
plt.plot(date_, temp_) | |
plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
06-06-2018 13:18:39 | 21.937 | |
06-06-2018 13:23:39 | 22.937 | |
06-06-2018 13:28:39 | 23.937 | |
06-06-2018 13:33:39 | 24.937 | |
06-06-2018 13:38:39 | 25.937 | |
06-06-2018 13:43:39 | 26.937 | |
06-06-2018 13:48:39 | 27.937 | |
06-06-2018 13:53:39 | 28.937 | |
06-06-2018 13:58:39 | 29.937 | |
06-06-2018 13:03:39 | 30.937 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment