|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
import csv |
|
|
|
|
import datetime |
|
|
|
|
|
|
|
|
|
time_tallies = dict() |
|
|
|
|
tally_totals = dict() |
|
|
|
|
|
|
|
|
|
with open("data/test-data.csv") as csv_file: |
|
|
|
|
def tally_readings_per_second(): |
|
|
|
|
time_tallies = dict() |
|
|
|
|
tally_totals = dict() |
|
|
|
|
with open("data/test-data.csv") as csv_file: |
|
|
|
|
csv_reader = csv.reader(csv_file, delimiter=",") |
|
|
|
|
for r in csv_reader: |
|
|
|
|
if (r[1] != "Time Stamp"): |
|
|
|
@ -18,10 +18,19 @@ with open("data/test-data.csv") as csv_file:
|
|
|
|
|
tally_totals[r2] = (tally_totals[r2]) + 1 |
|
|
|
|
else: |
|
|
|
|
tally_totals[r2] = 1 |
|
|
|
|
print(tally_totals.items()) |
|
|
|
|
with open("data/results/reading-per-sec.csv", mode="w") as result: |
|
|
|
|
# print(tally_totals.items()) |
|
|
|
|
return tally_totals |
|
|
|
|
|
|
|
|
|
def save_tally_totals(tally_totals): |
|
|
|
|
with open("data/results/readings-per-sec.csv", mode="w") as result: |
|
|
|
|
wtr = csv.writer(result) |
|
|
|
|
for k, v in tally_totals.items(): |
|
|
|
|
print(f"{k}: {v}") |
|
|
|
|
wtr.writerow([k,v]) |
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
|
time_tallies = tally_readings_per_second() |
|
|
|
|
save_tally_totals(time_tallies) |
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
|
main() |
|
|
|
|