-
Notifications
You must be signed in to change notification settings - Fork 0
/
COVID-19 APL.py
1999 lines (1638 loc) · 286 KB
/
COVID-19 APL.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#TEAM SOFTWARE ENGINEERING GROUP 2 - DATA ANALYSIS
#NATHAN JONES, ELA SALAH, RYAN MUSIWA, SAMUAL BAILEY, SAM DAVEY & BEN MOSS
#DEVELOPED AND CODED BY NATHAN JONES
#FEB/MAR/APR/MAY 2021
#COVID-19 AND POLUTION LEVELS TRACKER
#VERSION 1.1.9
#MAIN PROGRAM, TABS AND CHARTS CODED BY NATHAN JONES
#WRITTEN STATS CODED BY BEN MOSS
#MAPVIEW CODED BY SAM DAVEY
import tkinter as tk #IMPORTING THE TKINTER MODULE TO BE USED IN THE PROGRAM
import sys #ALLOWS ACCESS TO THE SYSTEM FROM WITHIN PYTHON
import os.path #ALLOWS THE PROGRAM TO OPEN OTHER SPECIFIC APPLICATIONS, IN THIS CASE THE GC PROGRAMS
import os #ALLOWS FOR CONTROL OF THE MACHINE AND IS OS INCLUDING THE LIKES OF SAVING, OPENING/CLOSING FILES, ETC.
import matplotlib.pyplot as plt #IMPORTING MATPLOTLIB SO THAT GRAPHS CAN BE CREATED AND PRODUCED IN THE PROGRAM
import pandas as pd #ALLOWS FOR CERTIAN MATHMATICAL FUNCTIONS AND READING OF CSV DATA TO TAKE PLACE
from tkinter import ttk #IMPORTING THE TKK MODULE THAT ALLOWS FOR TABBED WIDGETS
from tkinter import messagebox, Label, Button, FALSE, Tk, Entry #ALLOWING FOR TKINTER TO BE ACCESSED/UTILISED FOR THE PROGRAM TO USE ALL OF ITS FUNCTIONS AND GIVING THE PROGRAM A GUI
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg #ALLOWING FOR THE MATPLOTLIB GRAPHS TO BE INSERTED INTO THE TKINTER GUI'S
from PIL import Image, ImageTk #ALLOWS FOR THE IMPORTS OF IMAGES INTO THE PROGGRAM TO MAKE IT VISUALLY LOOK MORE PROFESSIONAL
def MenuMain():
MENU = Tk() #CREATING THE WINDOW THAT WILL BE DISPLAYED TO THE USER AND HOUSES ALL OF THE DIFFERENT TABS
MENU.title("COVID-19 Air Polution Levels") #GIVING THE WINDOW A TITLE
MENU.resizable(width=FALSE, height=FALSE) #THE WINDOW WILL NOT ENTER FULLSCREEN MODE
MENU.geometry("1690x700") #CONFIGURING THE FIXED SIZE OF THE WINDOW WHICH WILL ALWAYS BE THIS SIZE
tabControl = ttk.Notebook(MENU) #TELLING THE PROGRAM THAT WILL WILL BE A TABBED WIDGET
style = ttk.Style() #CREATING A TTK STYLE THAT WILL CHANGE THE COLOUR OF THE WIDGET
style.configure("W.TFrame", foreground="white", background="white") #SETTING THE BACKGROUND COLOUR TO BE WHITE, SO THAT THE WIDGET LOOKS SMARTER AND MORE PRESENTABLE
HOMEPAGETAB = ttk.Frame(style="W.TFrame") #CREATING THE HOME TAB ALONG WITH ITS BACKGROUND COLOUR
s1 = Label(HOMEPAGETAB, text=" ", bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s1.pack() #DISPLAYING THE SPCAE LABEL
l1 = Label(HOMEPAGETAB, text="COVID-19 & Air Pollution Levels - Homepage", font='Helvetica 12 bold', bg="white") #CREATING A MAIN HEADING FOR THE TAB THAT WILL BE AT THE TOP
l1.pack() #DISPLAYING THE LABEL
s3 = Label(HOMEPAGETAB, text=" ",bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s3.pack() #DISPLAYING THE SPCAE LABEL
l2 = Label(HOMEPAGETAB, text="Welcome To The Homepage!", font='Helvetica 10 bold', bg="white") #CREATING A SUB HEADING FOR THE DESCRIPTION
l2.pack() #DISPLAYING THE LABEL
l3 = Label(HOMEPAGETAB, text=
"""This is a COVID-19 Air Pollution tracking program that looks at the correlation between COVID-19 Lockdowns
and the overall pollution impact in certain European cities. The program utilses graphs and other visual stats to
allow for a visual representation of a significant or minimal difference in pollution levels as a result to the on going
pandemic.""",
font='Helvetica 10 ', bg="white") #CREATING A DESCRIPTION OF THE PROGRAM FOR THE USER TO SEE
l3.pack() #DISPLAYING THE LABEL
l4 = Label(HOMEPAGETAB, text=
"""The data that is being used in this program has been sourced from the World Air Quality Index Project (WAQIP)
and its Air Quality Historical Data Platform (https://aqicn.org/data-platform) that is a free to use service, that gathers
Air Quality Data (AQD) from various sources and groups them together to produce a databse that consits of AQD from
all over the World. As this program is free and for educational purposes we are allowed to use the data-sets from the
WAQIP as we are not making a profit and are solely using the data to educate and show a trend in the data.""",
font='Helvetica 10 ', bg="white") #CREATING A DESCRIPTION OF THE DATA USED FOR THE USER TO SEE
l4.pack() #DISPLAYING THE LABEL
l5 = Label(HOMEPAGETAB, text="Make sure to keep upto date with the latest updates and features with the website down below!",font='Helvetica 10', bg="white") #CREATING A SUB HEADING FOR THE DESCRIPTION
l5.pack() #DISPLAYING THE LABEL
s3 = Label(HOMEPAGETAB, text=" ", bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s3.pack() #DISPLAYING THE SPCAE LABEL
l6 = Label(HOMEPAGETAB, text="The Development Team",font='Helvetica 10 bold',bg="white") #CREATING A SUB HEADING FOR THE DESCRIPTION
l6.pack() #DISPLAYING THE LABEL
l7 = Label(HOMEPAGETAB, text=
"Nathan Jones, Ben Moss, Samual Bailey, Ryan Musiwa, Sam Davey & Ela Salah", font='Helvetica 10 ', bg="white") #CREATING A LABEL THAT LISTS EVERY ONE WHO IS INVOLVED WITH THE PROGRAM
l7.pack() #DISPLAYING THE LABEL THAT LISTS EVERY ONE WHO IS INVOLVED
s5 = Label(HOMEPAGETAB, text=" ", bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s5.pack() #DISPLAYING THE SPCAE LABEL
l8 = Label(HOMEPAGETAB, text="The Coding Team",font='Helvetica 10 bold',bg="white") #CREATING A SUB HEADING FOR THE DESCRIPTION
l8.pack() #DISPLAYING THE LABEL
l9 = Label(HOMEPAGETAB, text=
"Nathan Jones, Ben Moss & Sam Davey", font='Helvetica 10 ', bg="white") #CREATING A LABEL THAT LISTS EVERY ONE WHO CODED WITH THE PROGRAM
l9.pack() #DISPLAYING THE LABEL THAT LISTS EVERY ONE WHO IS INVOLVED WITH THE PROGRAM
s6 = Label(HOMEPAGETAB, text=" ", bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s6.pack() #DISPLAYING THE SPCAE LABEL
l10 = Label(HOMEPAGETAB, text="Contact Information",font='Helvetica 10 bold', bg="white") #CREATING A SUB HEADING FOR THE CONTACT INFORMATION
l10.pack() #DISPLAYING THE LABEL
l11 = Label(HOMEPAGETAB, text="Website: https://github.com/NathanDan/Data-Analysis-Team-Software-Engineering",font='Helvetica 10', bg="white") #CREATING A LABEL FOR THE DESCRIPTION OF THE CONTACT INFORMATION
l11.pack() #DISPLAYING THE LABEL
l12 = Label(HOMEPAGETAB, text="Version 1.1.9",font='Helvetica 9 bold', bg="white") #CREATING A LABEL THAT SHOWS WHAT VERSION THE USER IS ON
l12.place(x=1600, y=655) #DISPLAYING THE LABEL AT THE BOTTOM OF THE WINDOW
LONDONTAB = ttk.Frame(style="W.TFrame") #CREATING THE TAB THAT WILL HOUSE THE CITY'S DATA ALONG WITH ITS BACKGROUND COLOUR
s1 = Label(LONDONTAB, text=" ",bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s1.pack() #DISPLAYING THE SPCAE LABEL
l1 = Label(LONDONTAB, text="COVID-19 & Air Pollution Levels - London", font='Helvetica 12 bold',bg="white") #CREATING A MAIN HEADING FOR THE TAB THAT WILL BE AT THE TOP
l1.pack() #DISPLAYING THE LABEL
s2 = Label(LONDONTAB, text=" ",bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s2.pack() #DISPLAYING THE SPCAE LABEL
def LONLINEGRAPHS():
figure2019 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 GRAPH TO BE DISPLAYED IN
df19 = pd.read_csv('London\\London 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2019.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2019 = FigureCanvasTkAgg(figure2019, LONDONTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2019.get_tk_widget().place(x=20, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df19.plot(color='#d5d8dc', title='NO2 Levels In 2019 - London',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure1920 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 2020 COMPARISION GRAPH TO BE DISPLAYED IN
df191 = pd.read_csv('London\\London 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2019 POINTS
df201 = pd.read_csv('London\\London 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2020 POINTS
ax = figure1920.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart20201 = FigureCanvasTkAgg(figure1920, LONDONTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart20201.get_tk_widget().place(x=575, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df191.plot(color='#d5d8dc',ax=ax) #PLOTTING THE DATA FROM THE 2019 CSV FILE
df201.plot(color='#3498db', title='NO2 Levels In 2019 And 2020 - London',ax=ax) #PLOTTING THE DATA FROM THE 2020 CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure2020 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2020 GRAPH TO BE DISPLAYED IN
LD = pd.read_csv('London\\London Lockdown Dates.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA ON THE LOCKDOWNS TO POPULATE THE GRAPH
df20 = pd.read_csv('London\\London 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2020.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2020 = FigureCanvasTkAgg(figure2020, LONDONTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2020.get_tk_widget().place(x=1130, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df20.plot(color='#3498db', title='NO2 Levels In 2020 - London',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
LD.plot.area(color='#FF000015',ax=ax) #PLOTTING THE LOCKDOWN DATES ONTO THE 2020 GRAPH TO SEE IF THERE IS A SPIKE IN THE DATA
def LONAREAGRAPHS():
figure2019 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 GRAPH TO BE DISPLAYED IN
df19 = pd.read_csv('London\\London 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2019.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2019 = FigureCanvasTkAgg(figure2019, LONDONTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2019.get_tk_widget().place(x=20, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df19.plot.area(color='#d5d8dc', title='NO2 Levels In 2019 - London',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure1920 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 2020 COMPARISION GRAPH TO BE DISPLAYED IN
df191 = pd.read_csv('London\\London 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2019 POINTS
df201 = pd.read_csv('London\\London 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2020 POINTS
ax = figure1920.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart20201 = FigureCanvasTkAgg(figure1920, LONDONTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart20201.get_tk_widget().place(x=575, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df191.plot.area(color='#d5d8dc',ax=ax) #PLOTTING THE DATA FROM THE 2019 CSV FILE
df201.plot.area(color='#3498db', title='NO2 Levels In 2019 And 2020 - London',ax=ax) #PLOTTING THE DATA FROM THE 2020 CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure2020 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2020 GRAPH TO BE DISPLAYED IN
LD = pd.read_csv('London\\London Lockdown Dates.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA ON THE LOCKDOWNS TO POPULATE THE GRAPH
df20 = pd.read_csv('London\\London 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2020.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2020 = FigureCanvasTkAgg(figure2020, LONDONTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2020.get_tk_widget().place(x=1130, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df20.plot.area(color='#3498db', title='NO2 Levels In 2020 - London',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
LD.plot.area(color='#FF000025',ax=ax) #PLOTTING THE LOCKDOWN DATES ONTO THE 2020 GRAPH TO SEE IF THERE IS A SPIKE IN THE DATA
def LONSTATS():
canvas = tk.Canvas(LONDONTAB, width=1690, height=600, bg="white") #CREATING THE CANVAS FOR THE WRITTEN STATISTICS TO GO
canvas.place(x=0, y=90) #DISPLAYING THE CANVAS AND ITS LOCATION IN THE WINDOW
lS1 = Label(LONDONTAB, text="London 2019 NO2 Monthly Averages",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=145, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(LONDONTAB, text="January = 30",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=145, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(LONDONTAB, text="February = 28",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=145, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(LONDONTAB, text="March = 25",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=145, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(LONDONTAB, text="April = 43",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=145, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(LONDONTAB, text="May = 29",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=145, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(LONDONTAB, text="June = 25",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=145, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(LONDONTAB, text="July = 14",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=145, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(LONDONTAB, text="August = 33",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLE
lS9.place(x=145, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(LONDONTAB, text="September = 29",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=145, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(LONDONTAB, text="October = 29",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=145, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(LONDONTAB, text="November = 39",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=145, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(LONDONTAB, text="December = 34",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=145, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(LONDONTAB, text="London 2019 Highest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY AVERAGE LABEL
lS14.place(x=145, y=380) #DISPLAYING THE LABEL
lS15 = Label(LONDONTAB, text="November = 39",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=145, y=400) #DISPLAYING THE LABEL
lS16 = Label(LONDONTAB, text="London 2019 Lowest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE LOWEST MONTHLY AVERAGE LABEL
lS16.place(x=145, y=420) #DISPLAYING THE LABEL
lS17 = Label(LONDONTAB, text="July = 14",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=145, y=440) #DISPLAYING THE LABEL
lS18 = Label(LONDONTAB, text="London 2019 Yearly Average",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY AVERAGE LABEL
lS18.place(x=145, y=460) #DISPLAYING THE LABEL
lS19 = Label(LONDONTAB, text="NO2 Yearly Average Was 32.62",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=145, y=480) #DISPLAYING THE LABEL
lS1 = Label(LONDONTAB, text="London NO2 Monthly Changes",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=700, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(LONDONTAB, text="January = 10.53% DECREASE",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=700, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(LONDONTAB, text="February = 13.33% INCREASE",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=700, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(LONDONTAB, text="March On Average Had The Same NO2 Levels",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=700, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(LONDONTAB, text="April = 77.42% DECREASE",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=700, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(LONDONTAB, text="May = 35.90% DECREASE",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=700, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(LONDONTAB, text="June = 22.22% DECREASE",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=700, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(LONDONTAB, text="July = 6.90% INCREASE",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=700, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(LONDONTAB, text="August = 53.85% DECREASE",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLEL
lS9.place(x=700, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(LONDONTAB, text="September = 41.67% DECREASE",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=700, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(LONDONTAB, text="October = 63.64% DECREASE",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=700, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(LONDONTAB, text="November = 55.74% DECREASE",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=700, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(LONDONTAB, text="December = 47.28% DECREASE",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=700, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(LONDONTAB, text="London's Largest Monthy Change (DECREASE)",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY CHANGE (DECREASE) LABEL
lS14.place(x=700, y=380) #DISPLAYING THE LABEL
lS15 = Label(LONDONTAB, text="April = 77.42% DECREASE",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=700, y=400) #DISPLAYING THE LABEL
lS16 = Label(LONDONTAB, text="London's Largest Monthy Change (INCREASE)",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY CHANGE (INCREASE) LABEL
lS16.place(x=700, y=420) #DISPLAYING THE LABEL
lS17 = Label(LONDONTAB, text="February = 13.33% INCREASE",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=700, y=440) #DISPLAYING THE LABEL
lS18 = Label(LONDONTAB, text="London Yearly Average Change",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY CHANGE LABEL
lS18.place(x=700, y=460) #DISPLAYING THE LABEL
lS19 = Label(LONDONTAB, text="Yearly Average Change Was A 44.39% DECREASE In NO2 Levels",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=700, y=480) #DISPLAYING THE LABEL
lS1 = Label(LONDONTAB, text="London 2020 NO2 Monthly Averages",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=1255, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(LONDONTAB, text="January = 27",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=1255, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(LONDONTAB, text="February = 32",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=1255, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(LONDONTAB, text="March = 25",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=1255, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(LONDONTAB, text="April = 19",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=1255, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(LONDONTAB, text="May = 16",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=1255, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(LONDONTAB, text="June = 20",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=1255, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(LONDONTAB, text="July = 15",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=1255, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(LONDONTAB, text="August = 19",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLEL
lS9.place(x=1255, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(LONDONTAB, text="September = 19",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=1255, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(LONDONTAB, text="October = 15",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=1255, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(LONDONTAB, text="November = 22",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=1255, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(LONDONTAB, text="December = 21",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=1255, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(LONDONTAB, text="London 2020 Highest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY AVERAGE LABEL
lS14.place(x=1255, y=380) #DISPLAYING THE LABEL
lS15 = Label(LONDONTAB, text="February = 32",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=1255, y=400) #DISPLAYING THE LABEL
lS16 = Label(LONDONTAB, text="London 2020 Lowest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE LOWEST MONTHLY AVERAGE LABEL
lS16.place(x=1255, y=420) #DISPLAYING THE LABEL
lS17 = Label(LONDONTAB, text="July = 15 / October = 15",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=1255, y=440) #DISPLAYING THE LABEL
lS18 = Label(LONDONTAB, text="London 2020 Yearly Average",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY AVERAGE LABEL
lS18.place(x=1255, y=460) #DISPLAYING THE LABEL
lS19 = Label(LONDONTAB, text="NO2 Yearly Average Was 20.77",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=1255, y=480) #DISPLAYING THE LABEL
LONLINEGRAPHS() #DISPLAYING THE LINE GRAPH AS THE FIRST GRAPH TO BEEN SEEN IN THE PROGRAM SO IT ISNT AN EMPTY SCREEN
b1 = Button(LONDONTAB, text="Line Graphs", command=LONLINEGRAPHS) #CREATING THE BUTTON THAT DISPLAYS THE LINE GRAPHS FOR THE CITY
b2 = Button(LONDONTAB, text="Area Graphs", command=LONAREAGRAPHS) #CREATING THE BUTTON THAT DISPLAYS THE AREA GRAPHS FOR THE CITY
b3 = Button(LONDONTAB, text="Written Statistics", command=LONSTATS) #CREATING THE BUTTON THAT DISPLAYS THE WRITTEN STATISTICS FOR THE CITY
b1.place(x=720, y=50) #DISPLAYING THE LINE GRAPH BUTTON
b2.place(x=795, y=50) #DISPLAYING THE AREA GRAPH BUTTON
b3.place(x=872, y=50) #DISPLAYING THE YEARLY STATISTICS BUTTON
MADRIDTAB = ttk.Frame(style="W.TFrame") #CREATING THE TAB THAT WILL HOUSE THE CITY'S DATA ALONG WITH ITS BACKGROUND COLOUR
s1 = Label(MADRIDTAB, text=" ",bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s1.pack() #DISPLAYING THE SPACE LABEL
l1 = Label(MADRIDTAB, text="COVID-19 & Air Pollution Levels - Madrid", font='Helvetica 12 bold',bg="white") #CREATING A MAIN HEADING FOR THE TAB THAT WILL BE AT THE TOP
l1.pack() #DISPLAYING THE LABEL
s3 = Label(MADRIDTAB, text=" ",bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s3.pack() #DISPLAYING THE SPCAE LABEL
def MADLINEGRAPHS():
figure2019 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 GRAPH TO BE DISPLAYED IN
df19 = pd.read_csv('Madrid\\Madrid 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2019.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2019 = FigureCanvasTkAgg(figure2019, MADRIDTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2019.get_tk_widget().place(x=20, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df19.plot(color='#d5d8dc', title='NO2 Levels In 2019 - Madrid',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure1920 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 2020 COMPARISION GRAPH TO BE DISPLAYED IN
df191 = pd.read_csv('Madrid\\Madrid 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2019 POINTS
df201 = pd.read_csv('Madrid\\Madrid 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2020 POINTS
ax = figure1920.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart20201 = FigureCanvasTkAgg(figure1920, MADRIDTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart20201.get_tk_widget().place(x=575, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df191.plot(color='#d5d8dc',ax=ax) #PLOTTING THE DATA FROM THE 2019 CSV FILE
df201.plot(color='#3498db', title='NO2 Levels In 2019 And 2020 - Madrid',ax=ax) #PLOTTING THE DATA FROM THE 2020 CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure2020 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2020 GRAPH TO BE DISPLAYED IN
LD = pd.read_csv('Madrid\\Madrid Lockdown Dates.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA ON THE LOCKDOWNS TO POPULATE THE GRAPH
df20 = pd.read_csv('Madrid\\Madrid 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2020.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2020 = FigureCanvasTkAgg(figure2020, MADRIDTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2020.get_tk_widget().place(x=1130, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df20.plot(color='#3498db', title='NO2 Levels In 2020 - Madrid',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
LD.plot.area(color='#FF000015',ax=ax) #PLOTTING THE LOCKDOWN DATES ONTO THE 2020 GRAPH TO SEE IF THERE IS A SPIKE IN THE DATA
def MADAREAGRAPHS():
figure2019 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 GRAPH TO BE DISPLAYED IN
df19 = pd.read_csv('Madrid\\Madrid 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2019.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2019 = FigureCanvasTkAgg(figure2019, MADRIDTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2019.get_tk_widget().place(x=20, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df19.plot.area(color='#d5d8dc', title='NO2 Levels In 2019 - Madrid',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure1920 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 2020 COMPARISION GRAPH TO BE DISPLAYED IN
df191 = pd.read_csv('Madrid\\Madrid 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2019 POINTS
df201 = pd.read_csv('Madrid\\Madrid 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2020 POINTS
ax = figure1920.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart20201 = FigureCanvasTkAgg(figure1920, MADRIDTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart20201.get_tk_widget().place(x=575, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df191.plot.area(color='#d5d8dc',ax=ax) #PLOTTING THE DATA FROM THE 2019 CSV FILE
df201.plot.area(color='#3498db', title='NO2 Levels In 2019 And 2020 - Madrid',ax=ax) #PLOTTING THE DATA FROM THE 2020 CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure2020 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2020 GRAPH TO BE DISPLAYED IN
LD = pd.read_csv('Madrid\\Madrid Lockdown Dates.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA ON THE LOCKDOWNS TO POPULATE THE GRAPH
df20 = pd.read_csv('Madrid\\Madrid 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2020.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2020 = FigureCanvasTkAgg(figure2020, MADRIDTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2020.get_tk_widget().place(x=1130, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df20.plot.area(color='#3498db', title='NO2 Levels In 2020 - Madrid',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
LD.plot.area(color='#FF000025',ax=ax) #PLOTTING THE LOCKDOWN DATES ONTO THE 2020 GRAPH TO SEE IF THERE IS A SPIKE IN THE DATA
def MADSTATS():
canvas = tk.Canvas(MADRIDTAB, width=1690, height=600, bg="white") #CREATING THE CANVAS FOR THE WRITTEN STATISTICS TO GO
canvas.place(x=0, y=90) #DISPLAYING THE CANVAS AND ITS LOCATION IN THE WINDOW
lS1 = Label(MADRIDTAB, text="Madrid 2019 NO2 Monthly Averages",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=145, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(MADRIDTAB, text="January = 34",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=145, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(MADRIDTAB, text="February = 36",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=145, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(MADRIDTAB, text="March = 26",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=145, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(MADRIDTAB, text="April = 21",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=145, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(MADRIDTAB, text="May = 19",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=145, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(MADRIDTAB, text="June = 19",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=145, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(MADRIDTAB, text="July = 15",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=145, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(MADRIDTAB, text="August = 17",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLE
lS9.place(x=145, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(MADRIDTAB, text="September = 22",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=145, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(MADRIDTAB, text="October = 26",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=145, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(MADRIDTAB, text="November = 18",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=145, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(MADRIDTAB, text="December = 24",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=145, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(MADRIDTAB, text="Madrid 2019 Highest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY AVERAGE LABEL
lS14.place(x=145, y=380) #DISPLAYING THE LABEL
lS15 = Label(MADRIDTAB, text="February = 36",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=145, y=400) #DISPLAYING THE LABEL
lS16 = Label(MADRIDTAB, text="Madrid 2019 Lowest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE LOWEST MONTHLY AVERAGE LABEL
lS16.place(x=145, y=420) #DISPLAYING THE LABEL
lS17 = Label(MADRIDTAB, text="July = 15",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=145, y=440) #DISPLAYING THE LABEL
lS18 = Label(MADRIDTAB, text="Madrid 2019 Yearly Average",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY AVERAGE LABEL
lS18.place(x=145, y=460) #DISPLAYING THE LABEL
lS19 = Label(MADRIDTAB, text="NO2 Yearly Average Was 23.08",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=145, y=480) #DISPLAYING THE LABEL
lS1 = Label(MADRIDTAB, text="Madrid NO2 Monthly Changes",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=700, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(MADRIDTAB, text="January = 15.87% DECREASE",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=700, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(MADRIDTAB, text="February = 25% DECREASE",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=700, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(MADRIDTAB, text="March = 47.62% DECREASE",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=700, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(MADRIDTAB, text="April = 89.66% DECREASE",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=700, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(MADRIDTAB, text="May = 71.43% DECREASE",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=700, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(MADRIDTAB, text="June = 45.16% DECREASE",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=700, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(MADRIDTAB, text="July On Average Had The Same NO2 Levels",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=700, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(MADRIDTAB, text="August = 12.5% DECREASE",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLEL
lS9.place(x=700, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(MADRIDTAB, text="September = 14.63% DECREASE",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=700, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(MADRIDTAB, text="October = 21.28% DECREASE",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=700, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(MADRIDTAB, text="November = 40% INCREASE",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=700, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(MADRIDTAB, text="December = 18.18% DECREASE",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=700, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(MADRIDTAB, text="Madrid's Largest Monthy Change (DECREASE)",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY CHANGE (DECREASE) LABEL
lS14.place(x=700, y=380) #DISPLAYING THE LABEL
lS15 = Label(MADRIDTAB, text="April = 89.66% DECREASE",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=700, y=400) #DISPLAYING THE LABEL
lS16 = Label(MADRIDTAB, text="Madrid's Largest Monthy Change (INCREASE)",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY CHANGE (INCREASE) LABEL
lS16.place(x=700, y=420) #DISPLAYING THE LABEL
lS17 = Label(MADRIDTAB, text="November = 40% INCREASE",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=700, y=440) #DISPLAYING THE LABEL
lS18 = Label(MADRIDTAB, text="Madrid Yearly Average Change",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY CHANGE LABEL
lS18.place(x=700, y=460) #DISPLAYING THE LABEL
lS19 = Label(MADRIDTAB, text="Yearly Average Change Was A 23.37% DECREASE In NO2 Levels",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=700, y=480) #DISPLAYING THE LABEL
lS1 = Label(MADRIDTAB, text="Madrid 2020 NO2 Monthly Averages",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=1255, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(MADRIDTAB, text="January = 29",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=1255, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(MADRIDTAB, text="February = 28",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=1255, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(MADRIDTAB, text="March = 16",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=1255, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(MADRIDTAB, text="April = 8",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=1255, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(MADRIDTAB, text="May = 9",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=1255, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(MADRIDTAB, text="June = 12",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=1255, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(MADRIDTAB, text="July = 15",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=1255, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(MADRIDTAB, text="August = 15",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLEL
lS9.place(x=1255, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(MADRIDTAB, text="September = 19",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=1255, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(MADRIDTAB, text="October = 21",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=1255, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(MADRIDTAB, text="November = 27",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=1255, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(MADRIDTAB, text="December = 20",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=1255, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(MADRIDTAB, text="Madrid 2020 Highest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY AVERAGE LABEL
lS14.place(x=1255, y=380) #DISPLAYING THE LABEL
lS15 = Label(MADRIDTAB, text="January = 29",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=1255, y=400) #DISPLAYING THE LABEL
lS16 = Label(MADRIDTAB, text="Madrid 2020 Lowest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE LOWEST MONTHLY AVERAGE LABEL
lS16.place(x=1255, y=420) #DISPLAYING THE LABEL
lS17 = Label(MADRIDTAB, text="April = 8",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=1255, y=440) #DISPLAYING THE LABEL
lS18 = Label(MADRIDTAB, text="Madrid 2020 Yearly Average",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY AVERAGE LABEL
lS18.place(x=1255, y=460) #DISPLAYING THE LABEL
lS19 = Label(MADRIDTAB, text="NO2 Yearly Average Was 18.25",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=1255, y=480) #DISPLAYING THE LABEL
MADLINEGRAPHS() #DISPLAYING THE LINE GRAPH AS THE FIRST GRAPH TO BEEN SEEN IN THE PROGRAM SO IT ISNT AN EMPTY SCREEN
b1 = Button(MADRIDTAB, text="Line Graphs", command=MADLINEGRAPHS) #CREATING THE BUTTON THAT DISPLAYS THE LINE GRAPHS FOR THE CITY
b2 = Button(MADRIDTAB, text="Area Graphs", command=MADAREAGRAPHS) #CREATING THE BUTTON THAT DISPLAYS THE AREA GRAPHS FOR THE CITY
b3 = Button(MADRIDTAB, text="Written Statistics", command=MADSTATS) #CREATING THE BUTTON THAT DISPLAYS THE WRITTEN STATISTICS FOR THE CITY
b1.place(x=720, y=50) #DISPLAYING THE LINE GRAPH BUTTON
b2.place(x=795, y=50) #DISPLAYING THE AREA GRAPH BUTTON
b3.place(x=872, y=50) #DISPLAYING THE YEARLY STATISTICS BUTTON
MILANTAB = ttk.Frame(style="W.TFrame") #CREATING THE TAB THAT WILL HOUSE THE CITY'S DATA ALONG WITH ITS BACKGROUND COLOUR
s1 = Label(MILANTAB, text=" ",bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s1.pack() #DISPLAYING THE SPCAE LABEL
l1 = Label(MILANTAB, text="COVID-19 & Air Pollution Levels - Milan", font='Helvetica 12 bold',bg="white") #CREATING A MAIN HEADING FOR THE TAB THAT WILL BE AT THE TOP
l1.pack() #DISPLAYING THE LABEL
s3 = Label(MILANTAB, text=" ",bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s3.pack() #DISPLAYING THE SPCAE LABEL
def MILLINEGRAPHS():
figure2019 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 GRAPH TO BE DISPLAYED IN
df19 = pd.read_csv('Milan\\Milan 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2019.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2019 = FigureCanvasTkAgg(figure2019, MILANTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2019.get_tk_widget().place(x=20, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df19.plot(color='#d5d8dc', title='NO2 Levels In 2019 - Milan',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure1920 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 2020 COMPARISION GRAPH TO BE DISPLAYED IN
df191 = pd.read_csv('Milan\\Milan 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2019 POINTS
df201 = pd.read_csv('Milan\\Milan 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2020 POINTS
ax = figure1920.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart20201 = FigureCanvasTkAgg(figure1920, MILANTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart20201.get_tk_widget().place(x=575, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df191.plot(color='#d5d8dc',ax=ax) #PLOTTING THE DATA FROM THE 2019 CSV FILE
df201.plot(color='#3498db', title='NO2 Levels In 2019 And 2020 - Milan',ax=ax) #PLOTTING THE DATA FROM THE 2020 CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure2020 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2020 GRAPH TO BE DISPLAYED IN
LD = pd.read_csv('Milan\\Milan Lockdown Dates.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA ON THE LOCKDOWNS TO POPULATE THE GRAPH
df20 = pd.read_csv('Milan\\Milan 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2020.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2020 = FigureCanvasTkAgg(figure2020, MILANTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2020.get_tk_widget().place(x=1130, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df20.plot(color='#3498db', title='NO2 Levels In 2020 - Milan',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
LD.plot.area(color='#FF000015',ax=ax) #PLOTTING THE LOCKDOWN DATES ONTO THE 2020 GRAPH TO SEE IF THERE IS A SPIKE IN THE DATA
def MILAREAGRAPHS():
figure2019 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 GRAPH TO BE DISPLAYED IN
df19 = pd.read_csv('Milan\\Milan 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2019.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2019 = FigureCanvasTkAgg(figure2019, MILANTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2019.get_tk_widget().place(x=20, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df19.plot.area(color='#d5d8dc', title='NO2 Levels In 2019 - Milan',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure1920 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 2020 COMPARISION GRAPH TO BE DISPLAYED IN
df191 = pd.read_csv('Milan\\Milan 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2019 POINTS
df201 = pd.read_csv('Milan\\Milan 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2020 POINTS
ax = figure1920.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart20201 = FigureCanvasTkAgg(figure1920, MILANTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart20201.get_tk_widget().place(x=575, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df191.plot.area(color='#d5d8dc',ax=ax) #PLOTTING THE DATA FROM THE 2019 CSV FILE
df201.plot.area(color='#3498db', title='NO2 Levels In 2019 And 2020 - Milan',ax=ax) #PLOTTING THE DATA FROM THE 2020 CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure2020 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2020 GRAPH TO BE DISPLAYED IN
LD = pd.read_csv('Milan\\Milan Lockdown Dates.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA ON THE LOCKDOWNS TO POPULATE THE GRAPH
df20 = pd.read_csv('Milan\\Milan 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2020.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2020 = FigureCanvasTkAgg(figure2020, MILANTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2020.get_tk_widget().place(x=1130, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df20.plot.area(color='#3498db', title='NO2 Levels In 2020 - Milan',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
LD.plot.area(color='#FF000025',ax=ax) #PLOTTING THE LOCKDOWN DATES ONTO THE 2020 GRAPH TO SEE IF THERE IS A SPIKE IN THE DATA
def MILSTATS():
canvas = tk.Canvas(MILANTAB, width=1690, height=600, bg="white") #CREATING THE CANVAS FOR THE WRITTEN STATISTICS TO GO
canvas.place(x=0, y=90) #DISPLAYING THE CANVAS AND ITS LOCATION IN THE WINDOW
lS1 = Label(MILANTAB, text="Milan 2019 NO2 Monthly Averages",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=145, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(MILANTAB, text="January = 40",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=145, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(MILANTAB, text="February = 44",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=145, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(MILANTAB, text="March = 34",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=145, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(MILANTAB, text="April = 18",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=145, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(MILANTAB, text="May = 14",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=145, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(MILANTAB, text="June = 19",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=145, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(MILANTAB, text="July = 21",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=145, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(MILANTAB, text="August = 19",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLE
lS9.place(x=145, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(MILANTAB, text="September = 31",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=145, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(MILANTAB, text="October = 33",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=145, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(MILANTAB, text="November = 31",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=145, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(MILANTAB, text="December = 41",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=145, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(MILANTAB, text="Milan 2019 Highest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY AVERAGE LABEL
lS14.place(x=145, y=380) #DISPLAYING THE LABEL
lS15 = Label(MILANTAB, text="February = 44",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=145, y=400) #DISPLAYING THE LABEL
lS16 = Label(MILANTAB, text="Milan 2019 Lowest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE LOWEST MONTHLY AVERAGE LABEL
lS16.place(x=145, y=420) #DISPLAYING THE LABEL
lS17 = Label(MILANTAB, text="May = 14",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=145, y=440) #DISPLAYING THE LABEL
lS18 = Label(MILANTAB, text="Milan 2019 Yearly Average",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY AVERAGE LABEL
lS18.place(x=145, y=460) #DISPLAYING THE LABEL
lS19 = Label(MILANTAB, text="NO2 Yearly Average Was 28.75",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=145, y=480) #DISPLAYING THE LABEL
lS1 = Label(MILANTAB, text="Milan NO2 Monthly Changes",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=700, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(MILANTAB, text="January = 4.88% INCREASE",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=700, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(MILANTAB, text="February = 20% DECREASE",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=700, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(MILANTAB, text="March = 22.95% DECREASE",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=700, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(MILANTAB, text="April = 20% INCREASE",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=700, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(MILANTAB, text="May = 40% INCREASE",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=700, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(MILANTAB, text="June = 19.05% INCREASE",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=700, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(MILANTAB, text="July = 21.28% INCREASE",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=700, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(MILANTAB, text="August = 19.05% INCREASE",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLEL
lS9.place(x=700, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(MILANTAB, text="September = 6.25% INCREASE",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=700, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(MILANTAB, text="October = 16.39% DECREASE",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=700, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(MILANTAB, text="November = 3.28% DECREASE",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=700, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(MILANTAB, text="December = 37.68% DECREASE",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=700, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(MILANTAB, text="Milan's Largest Monthy Change (DECREASE)",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY CHANGE (DECREASE) LABEL
lS14.place(x=700, y=380) #DISPLAYING THE LABEL
lS15 = Label(MILANTAB, text="December = 37.68% DECREASE",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=700, y=400) #DISPLAYING THE LABEL
lS16 = Label(MILANTAB, text="Milan's Largest Monthy Change (INCREASE)",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY CHANGE (INCREASE) LABEL
lS16.place(x=700, y=420) #DISPLAYING THE LABEL
lS17 = Label(BERLINTAB, text="May = 40% INCREASE",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=700, y=440) #DISPLAYING THE LABEL
lS18 = Label(MILANTAB, text="Milan Yearly Average Change",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY CHANGE LABEL
lS18.place(x=700, y=460) #DISPLAYING THE LABEL
lS19 = Label(MILANTAB, text="Yearly Average Change Was A 1.75% DECREASE In NO2 Levels",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=700, y=480) #DISPLAYING THE LABEL
lS1 = Label(MILANTAB, text="Milan 2020 NO2 Monthly Averages",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=1255, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(MILANTAB, text="January = 42",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=1255, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(MILANTAB, text="February = 36",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=1255, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(MILANTAB, text="March = 27",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=1255, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(MILANTAB, text="April = 22",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=1255, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(MILANTAB, text="May = 21",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=1255, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(MILANTAB, text="June = 23",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=1255, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(MILANTAB, text="July = 26",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=1255, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(MILANTAB, text="August = 23",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLEL
lS9.place(x=1255, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(MILANTAB, text="September = 33",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=1255, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(MILANTAB, text="October = 28",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=1255, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(MILANTAB, text="November = 30",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=1255, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(MILANTAB, text="December = 28",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=1255, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(MILANTAB, text="Milan 2020 Highest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY AVERAGE LABEL
lS14.place(x=1255, y=380) #DISPLAYING THE LABEL
lS15 = Label(MILANTAB, text="January = 42",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=1255, y=400) #DISPLAYING THE LABEL
lS16 = Label(MILANTAB, text="Milan 2020 Lowest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE LOWEST MONTHLY AVERAGE LABEL
lS16.place(x=1255, y=420) #DISPLAYING THE LABEL
lS17 = Label(MILANTAB, text="May = 21",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=1255, y=440) #DISPLAYING THE LABEL
lS18 = Label(MILANTAB, text="Milan 2020 Yearly Average",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY AVERAGE LABEL
lS18.place(x=1255, y=460) #DISPLAYING THE LABEL
lS19 = Label(MILANTAB, text="NO2 Yearly Average Was 28.25",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=1255, y=480) #DISPLAYING THE LABEL
MILLINEGRAPHS() #DISPLAYING THE LINE GRAPH AS THE FIRST GRAPH TO BEEN SEEN IN THE PROGRAM SO IT ISNT AN EMPTY SCREEN
b1 = Button(MILANTAB, text="Line Graphs", command=MILLINEGRAPHS) #CREATING THE BUTTON THAT DISPLAYS THE LINE GRAPHS FOR THE CITY
b2 = Button(MILANTAB, text="Area Graphs", command=MILAREAGRAPHS) #CREATING THE BUTTON THAT DISPLAYS THE AREA GRAPHS FOR THE CITY
b3 = Button(MILANTAB, text="Written Statistics", command=MILSTATS) #CREATING THE BUTTON THAT DISPLAYS THE WRITTEN STATISTICS FOR THE CITY
b1.place(x=720, y=50) #DISPLAYING THE LINE GRAPH BUTTON
b2.place(x=795, y=50) #DISPLAYING THE AREA GRAPH BUTTON
b3.place(x=872, y=50) #DISPLAYING THE YEARLY STATISTICS BUTTON
BERLINTAB = ttk.Frame(style="W.TFrame") #CREATING THE TAB THAT WILL HOUSE THE CITY'S DATA ALONG WITH ITS BACKGROUND COLOUR
s1 = Label(BERLINTAB, text=" ", bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s1.pack() #DISPLAYING THE SPCAE LABEL
l1 = Label(BERLINTAB, text="COVID-19 & Air Pollution Levels - Berlin", font='Helvetica 12 bold', bg="white") #CREATING A MAIN HEADING FOR THE TAB THAT WILL BE AT THE TOP
l1.pack() #DISPLAYING THE LABEL
s3 = Label(BERLINTAB, text=" ", bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s3.pack() #DISPLAYING THE SPCAE LABEL
def BERLINEGRAPHS():
figure2019 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 GRAPH TO BE DISPLAYED IN
df19 = pd.read_csv('Berlin\\Berlin 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2019.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2019 = FigureCanvasTkAgg(figure2019, BERLINTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2019.get_tk_widget().place(x=20, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df19.plot(color='#d5d8dc', title='NO2 Levels In 2019 - Berlin',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure1920 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 2020 COMPARISION GRAPH TO BE DISPLAYED IN
df191 = pd.read_csv('Berlin\\Berlin 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2019 POINTS
df201 = pd.read_csv('Berlin\\Berlin 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2020 POINTS
ax = figure1920.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart20201 = FigureCanvasTkAgg(figure1920, BERLINTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart20201.get_tk_widget().place(x=575, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df191.plot(color='#d5d8dc',ax=ax) #PLOTTING THE DATA FROM THE 2019 CSV FILE
df201.plot(color='#3498db', title='NO2 Levels In 2019 And 2020 - Berlin',ax=ax) #PLOTTING THE DATA FROM THE 2020 CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure2020 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2020 GRAPH TO BE DISPLAYED IN
LD = pd.read_csv('Berlin\\Berlin Lockdown Dates.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA ON THE LOCKDOWNS TO POPULATE THE GRAPH
df20 = pd.read_csv('Berlin\\Berlin 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2020.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2020 = FigureCanvasTkAgg(figure2020, BERLINTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2020.get_tk_widget().place(x=1130, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df20.plot(color='#3498db', title='NO2 Levels In 2020 - Berlin',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
LD.plot.area(color='#FF000015',ax=ax) #PLOTTING THE LOCKDOWN DATES ONTO THE 2020 GRAPH TO SEE IF THERE IS A SPIKE IN THE DATA
def BERAREAGRAPHS():
figure2019 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 GRAPH TO BE DISPLAYED IN
df19 = pd.read_csv('Berlin\\Berlin 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2019.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2019 = FigureCanvasTkAgg(figure2019, BERLINTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2019.get_tk_widget().place(x=20, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df19.plot.area(color='#d5d8dc', title='NO2 Levels In 2019 - Berlin',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure1920 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 2020 COMPARISION GRAPH TO BE DISPLAYED IN
df191 = pd.read_csv('Berlin\\Berlin 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2019 POINTS
df201 = pd.read_csv('Berlin\\Berlin 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2020 POINTS
ax = figure1920.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart20201 = FigureCanvasTkAgg(figure1920, BERLINTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart20201.get_tk_widget().place(x=575, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df191.plot.area(color='#d5d8dc',ax=ax) #PLOTTING THE DATA FROM THE 2019 CSV FILE
df201.plot.area(color='#3498db', title='NO2 Levels In 2019 And 2020 - Berlin',ax=ax) #PLOTTING THE DATA FROM THE 2020 CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure2020 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2020 GRAPH TO BE DISPLAYED IN
LD = pd.read_csv('Berlin\\Berlin Lockdown Dates.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA ON THE LOCKDOWNS TO POPULATE THE GRAPH
df20 = pd.read_csv('Berlin\\Berlin 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2020.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2020 = FigureCanvasTkAgg(figure2020, BERLINTAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2020.get_tk_widget().place(x=1130, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df20.plot.area(color='#3498db', title='NO2 Levels In 2020 - Berlin',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
LD.plot.area(color='#FF000025',ax=ax) #PLOTTING THE LOCKDOWN DATES ONTO THE 2020 GRAPH TO SEE IF THERE IS A SPIKE IN THE DATA
def BERSTATS():
canvas = tk.Canvas(BERLINTAB, width=1690, height=600, bg="white") #CREATING THE CANVAS FOR THE WRITTEN STATISTICS TO GO
canvas.place(x=0, y=90) #DISPLAYING THE CANVAS AND ITS LOCATION IN THE WINDOW
lS1 = Label(BERLINTAB, text="Berlin 2019 NO2 Monthly Averages",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=145, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(BERLINTAB, text="January = 23",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=145, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(BERLINTAB, text="February = 29",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=145, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(BERLINTAB, text="March = 22",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=145, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(BERLINTAB, text="April = 21",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=145, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(BERLINTAB, text="May = 21",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=145, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(BERLINTAB, text="June = 25",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=145, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(BERLINTAB, text="July = 19",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=145, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(BERLINTAB, text="August = 25",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLEL
lS9.place(x=145, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(BERLINTAB, text="September = 23",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=145, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(BERLINTAB, text="October = 23",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=145, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(BERLINTAB, text="November = 20",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=145, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(BERLINTAB, text="December = 22",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=145, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(BERLINTAB, text="Berlin 2019 Highest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY AVERAGE LABEL
lS14.place(x=145, y=380) #DISPLAYING THE LABEL
lS15 = Label(BERLINTAB, text="February = 29",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=145, y=400) #DISPLAYING THE LABEL
lS16 = Label(BERLINTAB, text="Berlin 2019 Lowest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE LOWEST MONTHLY AVERAGE LABEL
lS16.place(x=145, y=420) #DISPLAYING THE LABEL
lS17 = Label(BERLINTAB, text="July = 19",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=145, y=440) #DISPLAYING THE LABEL
lS18 = Label(BERLINTAB, text="Berlin 2019 Yearly Average",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY AVERAGE LABEL
lS18.place(x=145, y=460) #DISPLAYING THE LABEL
lS19 = Label(BERLINTAB, text="NO2 Yearly Average Was 22.75",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=145, y=480) #DISPLAYING THE LABEL
lS1 = Label(BERLINTAB, text="Berlin NO2 Monthly Changes",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=700, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(BERLINTAB, text="January On Average Had The Same NO2 Levels",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=700, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(BERLINTAB, text="February = 36.73% DECREASE",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=700, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(BERLINTAB, text="March = 4.65% DECREASE",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=700, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(BERLINTAB, text="April = 10% DECREASE",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=700, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(BERLINTAB, text="May = 15.38% DECREASE",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=700, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(BERLINTAB, text="June = 12.77% DECREASE",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=700, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(BERLINTAB, text="July = 10% INCREASE",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=700, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(BERLINTAB, text="August = 17.39% DECREASE",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLEL
lS9.place(x=700, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(BERLINTAB, text="September = 4.26% INCREASE",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=700, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(BERLINTAB, text="October = 30% DECREASE",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=700, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(BERLINTAB, text="November = 10.53% DECREASE",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=700, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(BERLINTAB, text="December = 31.58% DECREASE",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=700, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(BERLINTAB, text="Berlin's Largest Monthy Change (DECREASE)",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY CHANGE (DECREASE) LABEL
lS14.place(x=700, y=380) #DISPLAYING THE LABEL
lS15 = Label(BERLINTAB, text="February = 36.73% DECREASE",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=700, y=400) #DISPLAYING THE LABEL
lS16 = Label(BERLINTAB, text="Berlin's Largest Monthy Change (INCREASE)",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY CHANGE (INCREASE) LABEL
lS16.place(x=700, y=420) #DISPLAYING THE LABEL
lS17 = Label(BERLINTAB, text="July = 10% INCREASE",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=700, y=440) #DISPLAYING THE LABEL
lS18 = Label(BERLINTAB, text="Berlin Yearly Average Change",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY CHANGE LABEL
lS18.place(x=700, y=460) #DISPLAYING THE LABEL
lS19 = Label(BERLINTAB, text="Yearly Average Change Was A 12.87% DECREASE In NO2 Levels",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=700, y=480) #DISPLAYING THE LABEL
lS1 = Label(BERLINTAB, text="Berlin 2020 NO2 Monthly Averages",font='Helvetica 10 bold', bg="white") #CREATING A LABEL THAT WILL ACT AS THE HEADING FOR THE WRITTEN STATISTICS
lS1.place(x=1255, y=100) #DISPLAYING THE HEADING LABEL
lS2 = Label(BERLINTAB, text="January = 23",font='Helvetica 9', bg="white") #CREATING THE JANUARY LABEL
lS2.place(x=1255, y=120) #DISPLAYING THE JANUARY LABEL
lS3 = Label(BERLINTAB, text="February = 20",font='Helvetica 9', bg="white") #CREATING THE FEBRUARY LABEL
lS3.place(x=1255, y=140) #DISPLAYING THE FEBRUARY LABEL
lS4 = Label(BERLINTAB, text="March = 21",font='Helvetica 9', bg="white") #CREATING THE MARCH LABEL
lS4.place(x=1255, y=160) #DISPLAYING THE MARCH LABEL
lS5 = Label(BERLINTAB, text="April = 19",font='Helvetica 9', bg="white") #CREATING THE APRIL LABEL
lS5.place(x=1255, y=180) #DISPLAYING THE APRIL LABEL
lS6 = Label(BERLINTAB, text="May = 18",font='Helvetica 9', bg="white") #CREATING THE MAY LABEL
lS6.place(x=1255, y=200) #DISPLAYING THE MAY LABEL
lS7 = Label(BERLINTAB, text="June = 22 - Only 5 Data Points",font='Helvetica 9', bg="white") #CREATING THE JUNE LABEL
lS7.place(x=1255, y=220) #DISPLAYING THE JUNE LABEL
lS8 = Label(BERLINTAB, text="July = 21",font='Helvetica 9', bg="white") #CREATING THE JULY LABEL
lS8.place(x=1255, y=240) #DISPLAYING THE JULY LABEL
lS9 = Label(BERLINTAB, text="August = 21",font='Helvetica 9', bg="white") #CREATING THE AUGUST LABLEL
lS9.place(x=1255, y=260) #DISPLAYING THE AUGUST LABEL
lS10 = Label(BERLINTAB, text="September = 24",font='Helvetica 9', bg="white") #CREATING THE SEPTEMBER LABEL
lS10.place(x=1255, y=280) #DISPLAYING THE SEPTEMBER LABEL
lS11 = Label(BERLINTAB, text="October = 17",font='Helvetica 9', bg="white") #CREATING THE OCTOBER LABEL
lS11.place(x=1255, y=300) #DISLAYING THE OCTOBER LABEL
lS12 = Label(BERLINTAB, text="November = 18",font='Helvetica 9', bg="white") #CREATING THE NOVEMBER LABEL
lS12.place(x=1255, y=320) #DISPLAYING THE NOVEMBER LABEL
lS13 = Label(BERLINTAB, text="December = 16",font='Helvetica 9', bg="white") #CREATING THE DECEMBER LABEL
lS13.place(x=1255, y=340) #DISPLAYING THE DECEMBER LABEL
lS14 = Label(BERLINTAB, text="Berlin 2020 Highest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE HIGHEST MONTHLY AVERAGE LABEL
lS14.place(x=1255, y=380) #DISPLAYING THE LABEL
lS15 = Label(BERLINTAB, text="September = 24",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS15.place(x=1255, y=400) #DISPLAYING THE LABEL
lS16 = Label(BERLINTAB, text="Berlin 2020 Lowest NO2 Monthly Average",font='Helvetica 10 bold', bg="white") #CREATING THE LOWEST MONTHLY AVERAGE LABEL
lS16.place(x=1255, y=420) #DISPLAYING THE LABEL
lS17 = Label(BERLINTAB, text="December = 16",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS17.place(x=1255, y=440) #DISPLAYING THE LABEL
lS18 = Label(BERLINTAB, text="Berlin 2020 Yearly Average",font='Helvetica 10 bold', bg="white") #CREATING THE YEARLY AVERAGE LABEL
lS18.place(x=1255, y=460) #DISPLAYING THE LABEL
lS19 = Label(BERLINTAB, text="NO2 Yearly Average Was 20",font='Helvetica 9', bg="white") #CREATING THE DATA LABEL
lS19.place(x=1255, y=480) #DISPLAYING THE LABEL
BERLINEGRAPHS() #DISPLAYING THE LINE GRAPH AS THE FIRST GRAPH TO BEEN SEEN IN THE PROGRAM SO IT ISNT AN EMPTY SCREEN
b1 = Button(BERLINTAB, text="Line Graphs", command=BERLINEGRAPHS) #CREATING THE BUTTON THAT DISPLAYS THE LINE GRAPHS FOR THE CITY
b2 = Button(BERLINTAB, text="Area Graphs", command=BERAREAGRAPHS) #CREATING THE BUTTON THAT DISPLAYS THE AREA GRAPHS FOR THE CITY
b3 = Button(BERLINTAB, text="Written Statistics", command=BERSTATS) #CREATING THE BUTTON THAT DISPLAYS THE WRITTEN STATISTICS FOR THE CITY
b1.place(x=720, y=50) #DISPLAYING THE LINE GRAPH BUTTON
b2.place(x=795, y=50) #DISPLAYING THE AREA GRAPH BUTTON
b3.place(x=872, y=50) #DISPLAYING THE YEARLY STATISTICS BUTTON
BARCELONATAB = ttk.Frame(style="W.TFrame") #CREATING THE TAB THAT WILL HOUSE THE CITY'S DATA ALONG WITH ITS BACKGROUND COLOUR
s1 = Label(BARCELONATAB, text=" ",bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s1.pack() #DISPLAYING THE SPCAE LABEL
l1 = Label(BARCELONATAB, text="COVID-19 & Air Pollution Levels - Barcelona", font='Helvetica 12 bold',bg="white") #CREATING A MAIN HEADING FOR THE TAB THAT WILL BE AT THE TOP
l1.pack() #DISPLAYING THE LABEL
s3 = Label(BARCELONATAB, text=" ",bg="white") #CREATING AN EMPTY LABEL THAT WILL ACT AS A ONE LINE SPACE
s3.pack() #DISPLAYING THE SPCAE LABEL
def BARLINEGRAPHS():
figure2019 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 GRAPH TO BE DISPLAYED IN
df19 = pd.read_csv('Barcelona\\Barcelona 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH
ax = figure2019.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart2019 = FigureCanvasTkAgg(figure2019, BARCELONATAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart2019.get_tk_widget().place(x=20, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df19.plot(color='#d5d8dc', title='NO2 Levels In 2019 - Barcelona',ax=ax) #PLOTTING THE DATA FROM THE CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure1920 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2019 2020 COMPARISION GRAPH TO BE DISPLAYED IN
df191 = pd.read_csv('Barcelona\\Barcelona 2019.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2019 POINTS
df201 = pd.read_csv('Barcelona\\Barcelona 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE 2020 POINTS
ax = figure1920.add_subplot(111) #ADDING THE GRAPH TO THE FRAME
Chart20201 = FigureCanvasTkAgg(figure1920, BARCELONATAB) #DISPLAYING THE GRAPH IN THE TKINTER TAB FOR THE CITY
Chart20201.get_tk_widget().place(x=575, y=100) #POSITIONING THE GRAPH SO THAT THEY WILL ALL SIT ALONGSIDE EACH OTHER ON ONE ROW
ax.set_ylabel("NO2 Level") #SETTING THE Y LABEL ON THE GRAPH TO BE "NO2 Level"
df191.plot(color='#d5d8dc',ax=ax) #PLOTTING THE DATA FROM THE 2019 CSV FILE
df201.plot(color='#3498db', title='NO2 Levels In 2019 And 2020 - Barcelona',ax=ax) #PLOTTING THE DATA FROM THE 2020 CSV FILE AND ADDING A TITLE TO THE WHOLE GRAPH
figure2020 = plt.Figure(figsize=(6,5), dpi=90) #CREATING THE FRAME FOR THE 2020 GRAPH TO BE DISPLAYED IN
LD = pd.read_csv('Barcelona\\Barcelona Lockdown Dates.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA ON THE LOCKDOWNS TO POPULATE THE GRAPH
df20 = pd.read_csv('Barcelona\\Barcelona 2020.csv', parse_dates=['Month'], index_col="Month") #READING THE CSV FILE WITH ALL OF THE DATA INSIDE TO POPULATE THE GRAPH