-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnalyzeTravelynx.py
59 lines (37 loc) · 1.38 KB
/
AnalyzeTravelynx.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import json
raw_data=open('history.json')
data=json.load(raw_data)
TypeListRaw=list()
TypeListSorted=list()
StationListRaw=list()
StationListSorted=list()
CommuteRouteStation1=""
CommuteRouteStation2=""
HomeStationList=[""]
homecounter=0
commutecounter=0
print("Zug-Statistiken: ")
for dataset in data:
TypeListRaw.append(dataset['type'])
if dataset['to_name'] == CommuteRouteStation1 and dataset['from_name'] == CommuteRouteStation2:
commutecounter = commutecounter + 1
elif dataset['to_name'] == CommuteRouteStation2 and dataset['from_name'] == CommuteRouteStation1:
commutecounter = commutecounter + 1
for item in TypeListRaw:
if item not in TypeListSorted:
TypeListSorted.append(item)
for searchfor in TypeListSorted:
print("Du bist",TypeListRaw.count(searchfor),"mal mit ",searchfor, " gefahren")
print("Stations-Statistiken: ")
for dataset in data:
StationListRaw.append(dataset['to_name'])
for item in StationListRaw:
if item not in StationListSorted:
StationListSorted.append(item)
for searchfor in StationListSorted:
print("Du bist",StationListRaw.count(searchfor),"mal nach ",searchfor, " gefahren")
for searchfor in StationListRaw:
if searchfor in HomeStationList:
homecounter=homecounter+1
print("Du bist",homecounter,"mal nach Hause gefahren")
print("Du bist",commutecounter,"mal deine Stammstrecke gefahren")