Kartheesh commited on
Commit
22cdaae
·
1 Parent(s): 0f42330

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1032
app.py CHANGED
@@ -15,962 +15,7 @@ def greet(year,co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emi
15
  eq1=2.29209688*(co2_emission)+(-17.24834114)*(No2_emission)+(-34.46449984)*(so2_emission)+441.88734541*(Global_Warming)+(-10.5704468)*(Methane_emission)+3032.3276611889232
16
 
17
 
18
- #1997
19
-
20
- #data collection
21
- data2=pd.read_excel("/content/ans1 (1).xlsx")
22
- df2 = data2.drop(['YEAR '], axis=1)
23
-
24
-
25
-
26
- #data indexing
27
- x=df2.iloc[:,1:].values
28
- y=df2.iloc[:,0].values
29
- np.reshape(y,(-1,1))
30
-
31
- #split the dataset
32
- from sklearn.model_selection import train_test_split
33
- X_train, X_test, y_train, y_test = train_test_split(
34
- x, y, test_size=0.33, random_state=42)
35
-
36
-
37
- #traing the dataset
38
- from sklearn.linear_model import LinearRegression
39
-
40
- reg = LinearRegression().fit(X_train, y_train)
41
-
42
-
43
- y_pred2=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
44
-
45
-
46
-
47
-
48
-
49
- #Equation
50
- total2="1.87191609*(x1)+19.64115875*(x2)+91.64048224*(x3)+188.38350818*(x4)+23.55498894*(x5)-10954.252919457198"
51
-
52
-
53
-
54
- #1998
55
-
56
- #data collection
57
- data3=pd.read_excel("/content/ans2.xlsx")
58
- df3 = data3.drop([' YEAR '], axis=1)
59
-
60
-
61
-
62
- #data indexing
63
- x=df3.iloc[:,1:].values
64
- y=df3.iloc[:,0].values
65
- np.reshape(y,(-1,1))
66
-
67
- #split the dataset
68
- from sklearn.model_selection import train_test_split
69
- X_train, X_test, y_train, y_test = train_test_split(
70
- x, y, test_size=0.33, random_state=42)
71
-
72
-
73
- #traing the dataset
74
- from sklearn.linear_model import LinearRegression
75
-
76
- reg = LinearRegression().fit(X_train, y_train)
77
-
78
-
79
- y_pred3=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
80
-
81
-
82
-
83
-
84
-
85
- #Equation
86
- total3="-16.16933055*(x1)+222.22199705*(x2)+137.12332335*(x3)+325.31073157*(x4)+(-123.63496668)*(x5)+56972.685015326366"
87
-
88
-
89
-
90
- #1999
91
-
92
- #data collection
93
- data4=pd.read_excel("/content/ans3.xlsx")
94
- df4 = data4.drop([' YEAR '], axis=1)
95
-
96
-
97
-
98
- #data indexing
99
- x=df4.iloc[:,1:].values
100
- y=df4.iloc[:,0].values
101
- np.reshape(y,(-1,1))
102
-
103
- #split the dataset
104
- from sklearn.model_selection import train_test_split
105
- X_train, X_test, y_train, y_test = train_test_split(
106
- x, y, test_size=0.33, random_state=42)
107
-
108
-
109
- #traing the dataset
110
- from sklearn.linear_model import LinearRegression
111
-
112
- reg = LinearRegression().fit(X_train, y_train)
113
-
114
-
115
- y_pred4=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
116
-
117
-
118
-
119
-
120
-
121
- #Equation
122
- total4="24.45036879*(x1)+(-30.15985323)*(x2)+40.89603753*(x3)+102.95011027*(x4)+(-26.35323684)*(x5)+7934.309705068432"
123
-
124
-
125
-
126
- #2000
127
-
128
- #data collection
129
- data5=pd.read_excel("/content/ans4.xlsx")
130
- df5 = data5.drop([' YEAR '], axis=1)
131
-
132
-
133
-
134
- #data indexing
135
- x=df5.iloc[:,1:].values
136
- y=df5.iloc[:,0].values
137
- np.reshape(y,(-1,1))
138
-
139
- #split the dataset
140
- from sklearn.model_selection import train_test_split
141
- X_train, X_test, y_train, y_test = train_test_split(
142
- x, y, test_size=0.33, random_state=42)
143
-
144
-
145
- #traing the dataset
146
- from sklearn.linear_model import LinearRegression
147
-
148
- reg = LinearRegression().fit(X_train, y_train)
149
-
150
-
151
- y_pred5=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
152
-
153
-
154
-
155
-
156
-
157
- #Equation
158
- total5="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
159
-
160
-
161
-
162
- #2001
163
-
164
- #data collection
165
- data6=pd.read_excel("/content/ans5.xlsx")
166
- df6 = data6.drop([' YEAR '], axis=1)
167
-
168
-
169
-
170
- #data indexing
171
- x=df6.iloc[:,1:].values
172
- y=df6.iloc[:,0].values
173
- np.reshape(y,(-1,1))
174
-
175
- #split the dataset
176
- from sklearn.model_selection import train_test_split
177
- X_train, X_test, y_train, y_test = train_test_split(
178
- x, y, test_size=0.33, random_state=42)
179
-
180
-
181
- #traing the dataset
182
- from sklearn.linear_model import LinearRegression
183
-
184
- reg = LinearRegression().fit(X_train, y_train)
185
-
186
-
187
- y_pred6=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
188
-
189
-
190
-
191
-
192
-
193
- #Equation
194
- total6="(-17.95980305)*(x1)+397.29027184*(x2)+332.85116421*(x3)+176.63505073*(x4)+(-100.69005777)*(x5)+47882.75497380103"
195
-
196
-
197
- #2002
198
-
199
- #data collection
200
- data7=pd.read_excel("/content/ans6.xlsx")
201
- df7 = data7.drop([' YEAR '], axis=1)
202
-
203
-
204
-
205
- #data indexing
206
- x=df7.iloc[:,1:].values
207
- y=df7.iloc[:,0].values
208
- np.reshape(y,(-1,1))
209
-
210
- #split the dataset
211
- from sklearn.model_selection import train_test_split
212
- X_train, X_test, y_train, y_test = train_test_split(
213
- x, y, test_size=0.33, random_state=42)
214
-
215
-
216
- #traing the dataset
217
- from sklearn.linear_model import LinearRegression
218
-
219
- reg = LinearRegression().fit(X_train, y_train)
220
-
221
-
222
- y_pred7=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
223
-
224
-
225
-
226
-
227
-
228
- #Equation
229
- total7="4.08573322*(x1)+531.87792204*(x2)+(-17.3614085 )*(x3)+(-11.17919737)*(x4)+(-53.48796076)*(x5)+22953.88111229325"
230
-
231
-
232
- #2003
233
-
234
- #data collection
235
- data8=pd.read_excel("/content/ans7.xlsx")
236
- df8 = data8.drop([' YEAR '], axis=1)
237
-
238
-
239
-
240
- #data indexing
241
- x=df8.iloc[:,1:].values
242
- y=df8.iloc[:,0].values
243
- np.reshape(y,(-1,1))
244
-
245
- #split the dataset
246
- from sklearn.model_selection import train_test_split
247
- X_train, X_test, y_train, y_test = train_test_split(
248
- x, y, test_size=0.33, random_state=42)
249
-
250
-
251
- #traing the dataset
252
- from sklearn.linear_model import LinearRegression
253
-
254
- reg = LinearRegression().fit(X_train, y_train)
255
-
256
-
257
- y_pred8=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
258
-
259
-
260
-
261
-
262
-
263
- #Equation
264
- total8="31.82512443*(x1)+(-521.96868383 )*(x2)+(-43.51829088)*(x3)+ 205.27514768 *(x4)+(-97.91577198)*(x5)+37973.451433772294"
265
-
266
-
267
-
268
- #2004
269
-
270
- #data collection
271
- data9=pd.read_excel("/content/ans8.xlsx")
272
- df9 = data9.drop([' YEAR '], axis=1)
273
-
274
-
275
-
276
- #data indexing
277
- x=df9.iloc[:,1:].values
278
- y=df9.iloc[:,0].values
279
- np.reshape(y,(-1,1))
280
-
281
- #split the dataset
282
- from sklearn.model_selection import train_test_split
283
- X_train, X_test, y_train, y_test = train_test_split(
284
- x, y, test_size=0.33, random_state=42)
285
-
286
-
287
- #traing the dataset
288
- from sklearn.linear_model import LinearRegression
289
-
290
- reg = LinearRegression().fit(X_train, y_train)
291
-
292
-
293
- y_pred9=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
294
-
295
-
296
-
297
-
298
-
299
- #Equation
300
- total9="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
301
-
302
-
303
-
304
- #2005
305
-
306
- #data collection
307
- data10=pd.read_excel("/content/ans9.xlsx")
308
- df10 = data10.drop([' YEAR '], axis=1)
309
-
310
-
311
-
312
- #data indexing
313
- x=df10.iloc[:,1:].values
314
- y=df10.iloc[:,0].values
315
- np.reshape(y,(-1,1))
316
-
317
- #split the dataset
318
- from sklearn.model_selection import train_test_split
319
- X_train, X_test, y_train, y_test = train_test_split(
320
- x, y, test_size=0.33, random_state=42)
321
-
322
-
323
- #traing the dataset
324
- from sklearn.linear_model import LinearRegression
325
-
326
- reg = LinearRegression().fit(X_train, y_train)
327
-
328
-
329
- y_pred10=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
330
-
331
-
332
-
333
-
334
-
335
- #Equation
336
- total10="(-46.41395388)*(x1)+27.19076539*(x2)+(442.44336049)*(x3)+(-205.61881527)*(x4)+120.39426307*(x5)-46289.48823133327"
337
-
338
-
339
-
340
- #2006
341
-
342
- #data collection
343
- data11=pd.read_excel("/content/ans10.xlsx")
344
- df11 = data11.drop([' YEAR '], axis=1)
345
-
346
-
347
-
348
- #data indexing
349
- x=df11.iloc[:,1:].values
350
- y=df11.iloc[:,0].values
351
- np.reshape(y,(-1,1))
352
-
353
- #split the dataset
354
- from sklearn.model_selection import train_test_split
355
- X_train, X_test, y_train, y_test = train_test_split(
356
- x, y, test_size=0.33, random_state=42)
357
-
358
-
359
- #traing the dataset
360
- from sklearn.linear_model import LinearRegression
361
-
362
- reg = LinearRegression().fit(X_train, y_train)
363
-
364
-
365
- y_pred11=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
366
-
367
-
368
-
369
-
370
-
371
- #Equation
372
- total11="(-15.45736104)*(x1)+23.92398419*(x2)+334.30252317*(x3)+151.55678804*(x4)+(-66.42769537)*(x5)+29294.014037250927"
373
-
374
-
375
-
376
-
377
- #2007
378
-
379
- #data collection
380
- data12=pd.read_excel("/content/ans11.xlsx")
381
- df12 = data12.drop([' YEAR '], axis=1)
382
-
383
-
384
-
385
- #data indexing
386
- x=df12.iloc[:,1:].values
387
- y=df12.iloc[:,0].values
388
- np.reshape(y,(-1,1))
389
-
390
- #split the dataset
391
- from sklearn.model_selection import train_test_split
392
- X_train, X_test, y_train, y_test = train_test_split(
393
- x, y, test_size=0.33, random_state=42)
394
-
395
-
396
- #traing the dataset
397
- from sklearn.linear_model import LinearRegression
398
-
399
- reg = LinearRegression().fit(X_train, y_train)
400
-
401
-
402
- y_pred12=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
403
-
404
-
405
-
406
-
407
-
408
- #Equation
409
- total12="33.41323832*(x1)+(-36.18735569)*(x2)+768.11444325*(x3)+(-182.42626044 )*(x4)+(14.70116631)*(x5)-6967.764713347897"
410
-
411
-
412
-
413
- #2008
414
-
415
- #data collection
416
- data13=pd.read_excel("/content/ans12.xlsx")
417
- df13 = data13.drop([' YEAR '], axis=1)
418
-
419
-
420
-
421
- #data indexing
422
- x=df13.iloc[:,1:].values
423
- y=df13.iloc[:,0].values
424
- np.reshape(y,(-1,1))
425
-
426
- #split the dataset
427
- from sklearn.model_selection import train_test_split
428
- X_train, X_test, y_train, y_test = train_test_split(
429
- x, y, test_size=0.33, random_state=42)
430
-
431
-
432
- #traing the dataset
433
- from sklearn.linear_model import LinearRegression
434
-
435
- reg = LinearRegression().fit(X_train, y_train)
436
-
437
-
438
- y_pred13=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
439
-
440
-
441
-
442
-
443
-
444
- #Equation
445
- total13="180.34683409 *(x1)+49.48628012*(x2)+152.71729516*(x3)+( -174.89679207)*(x4)+(-144.40854904)*(x5)+30420.505686819404"
446
-
447
-
448
-
449
-
450
-
451
- #2009
452
-
453
- #data collection
454
- data14=pd.read_excel("/content/ans13.xlsx")
455
- df14 = data14.drop([' YEAR '], axis=1)
456
-
457
-
458
-
459
- #data indexing
460
- x=df14.iloc[:,1:].values
461
- y=df14.iloc[:,0].values
462
- np.reshape(y,(-1,1))
463
-
464
- #split the dataset
465
- from sklearn.model_selection import train_test_split
466
- X_train, X_test, y_train, y_test = train_test_split(
467
- x, y, test_size=0.33, random_state=42)
468
-
469
-
470
- #traing the dataset
471
- from sklearn.linear_model import LinearRegression
472
-
473
- reg = LinearRegression().fit(X_train, y_train)
474
-
475
-
476
- y_pred14=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
477
-
478
-
479
-
480
-
481
-
482
- #Equation
483
- total14="17.11355138 *(x1)+37.59837451*(x2)+156.43469383*(x3)+(-104.8362236)*(x4)+81.10973597*(x5)-38919.678559060834"
484
-
485
-
486
-
487
-
488
- #2010
489
-
490
- #data collection
491
- data15=pd.read_excel("/content/ans14.xlsx")
492
- df15 = data15.drop([' YEAR '], axis=1)
493
-
494
-
495
-
496
- #data indexing
497
- x=df15.iloc[:,1:].values
498
- y=df15.iloc[:,0].values
499
- np.reshape(y,(-1,1))
500
-
501
- #split the dataset
502
- from sklearn.model_selection import train_test_split
503
- X_train, X_test, y_train, y_test = train_test_split(
504
- x, y, test_size=0.33, random_state=42)
505
-
506
-
507
- #traing the dataset
508
- from sklearn.linear_model import LinearRegression
509
-
510
- reg = LinearRegression().fit(X_train, y_train)
511
-
512
-
513
- y_pred15=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
514
-
515
-
516
-
517
-
518
-
519
- #Equation
520
- total15="39.06418699 *(x1)+148.53455807*(x2)+14.69213499 *(x3)+107.43795246*(x4)+(-207.77185028)*(x5)+82358.63651384937"
521
-
522
-
523
-
524
-
525
- #2011
526
-
527
- #data collection
528
- data16=pd.read_excel("/content/ans15.xlsx")
529
- df16 = data16.drop([' YEAR '], axis=1)
530
-
531
-
532
-
533
- #data indexing
534
- x=df16.iloc[:,1:].values
535
- y=df16.iloc[:,0].values
536
- np.reshape(y,(-1,1))
537
-
538
- #split the dataset
539
- from sklearn.model_selection import train_test_split
540
- X_train, X_test, y_train, y_test = train_test_split(
541
- x, y, test_size=0.33, random_state=42)
542
-
543
-
544
- #traing the dataset
545
- from sklearn.linear_model import LinearRegression
546
-
547
- reg = LinearRegression().fit(X_train, y_train)
548
-
549
-
550
- y_pred16=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
551
-
552
-
553
-
554
-
555
-
556
- #Equation
557
- total16="36.2551509 *(x1)+-21.16118114*(x2)+372.06856269*(x3)+(-59.04384028)*(x4)+(-49.61395171)*(x5)+18259.681897588325"
558
-
559
-
560
-
561
-
562
- #2012
563
-
564
- #data collection
565
- data17=pd.read_excel("/content/ans16.xlsx")
566
- df17 = data17.drop([' YEAR '], axis=1)
567
-
568
-
569
-
570
- #data indexing
571
- x=df17.iloc[:,1:].values
572
- y=df17.iloc[:,0].values
573
- np.reshape(y,(-1,1))
574
-
575
- #split the dataset
576
- from sklearn.model_selection import train_test_split
577
- X_train, X_test, y_train, y_test = train_test_split(
578
- x, y, test_size=0.33, random_state=42)
579
-
580
-
581
- #traing the dataset
582
- from sklearn.linear_model import LinearRegression
583
-
584
- reg = LinearRegression().fit(X_train, y_train)
585
-
586
-
587
- y_pred17=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
588
-
589
-
590
-
591
-
592
-
593
- #Equation
594
- total17="76.15862868 *(x1)+24.66304806*(x2)+(-31.1753211)*(x3)+(-281.13550722 )*(x4)+48.76763872*(x5)-27641.15357666507"
595
-
596
-
597
-
598
- #2013
599
-
600
- #data collection
601
- data18=pd.read_excel("/content/ans17.xlsx")
602
- df18 = data18.drop([' YEAR '], axis=1)
603
-
604
-
605
-
606
- #data indexing
607
- x=df18.iloc[:,1:].values
608
- y=df18.iloc[:,0].values
609
- np.reshape(y,(-1,1))
610
-
611
- #split the dataset
612
- from sklearn.model_selection import train_test_split
613
- X_train, X_test, y_train, y_test = train_test_split(
614
- x, y, test_size=0.33, random_state=42)
615
-
616
-
617
- #traing the dataset
618
- from sklearn.linear_model import LinearRegression
619
-
620
- reg = LinearRegression().fit(X_train, y_train)
621
-
622
-
623
- y_pred18=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
624
-
625
-
626
-
627
-
628
-
629
- #Equation
630
- total18="138.94519275 *(x1)+19.41784298*(x2)+160.13405515*(x3)+1190.40134987*(x4)+(-787.72926112)*(x5)+340350.32984524494"
631
-
632
-
633
-
634
-
635
-
636
- #2014
637
-
638
- #data collection
639
- data19=pd.read_excel("/content/ans18.xlsx")
640
- df19 = data19.drop([' YEAR '], axis=1)
641
-
642
-
643
-
644
- #data indexing
645
- x=df19.iloc[:,1:].values
646
- y=df19.iloc[:,0].values
647
- np.reshape(y,(-1,1))
648
-
649
- #split the dataset
650
- from sklearn.model_selection import train_test_split
651
- X_train, X_test, y_train, y_test = train_test_split(
652
- x, y, test_size=0.33, random_state=42)
653
-
654
-
655
- #traing the dataset
656
- from sklearn.linear_model import LinearRegression
657
-
658
- reg = LinearRegression().fit(X_train, y_train)
659
-
660
-
661
- y_pred19=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
662
-
663
-
664
-
665
-
666
-
667
- #Equation
668
- total19="83.98184027*(x1)+61.59628945*(x2)+740.33672736*(x3)+(-347.39343539)*(x4)+(-293.6388187)*(x5)+121547.59923111903"
669
-
670
-
671
-
672
-
673
-
674
- #2015
675
-
676
- #data collection
677
- data20=pd.read_excel("/content/ans19.xlsx")
678
- df20 = data20.drop([' YEAR '], axis=1)
679
-
680
-
681
-
682
- #data indexing
683
- x=df20.iloc[:,1:].values
684
- y=df20.iloc[:,0].values
685
- np.reshape(y,(-1,1))
686
-
687
- #split the dataset
688
- from sklearn.model_selection import train_test_split
689
- X_train, X_test, y_train, y_test = train_test_split(
690
- x, y, test_size=0.33, random_state=42)
691
-
692
-
693
- #traing the dataset
694
- from sklearn.linear_model import LinearRegression
695
-
696
- reg = LinearRegression().fit(X_train, y_train)
697
-
698
-
699
- y_pred20=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
700
-
701
-
702
-
703
-
704
-
705
- #Equation
706
- total20="25.74397202*(x1)+(-109.5936775)*(x2)+293.36826631*(x3)+(-52.97554351)*(x4)+178.24908664*(x5)-80332.13002824014"
707
-
708
-
709
-
710
-
711
-
712
-
713
-
714
- #2016
715
-
716
- #data collection
717
- data21=pd.read_excel("/content/ans20.xlsx")
718
- df21 = data21.drop([' YEAR '], axis=1)
719
-
720
-
721
-
722
- #data indexing
723
- x=df21.iloc[:,1:].values
724
- y=df21.iloc[:,0].values
725
- np.reshape(y,(-1,1))
726
-
727
- #split the dataset
728
- from sklearn.model_selection import train_test_split
729
- X_train, X_test, y_train, y_test = train_test_split(
730
- x, y, test_size=0.33, random_state=42)
731
-
732
-
733
- #traing the dataset
734
- from sklearn.linear_model import LinearRegression
735
-
736
- reg = LinearRegression().fit(X_train, y_train)
737
-
738
-
739
- y_pred21=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
740
-
741
-
742
-
743
-
744
-
745
- #Equation
746
- total21="-9.33709575 *(x1)+(-60.54283141)*(x2)+1291.89291784*(x3)+112.70137053*(x4)+167.06117048*(x5)-76365.90014799789"
747
-
748
-
749
-
750
-
751
-
752
- #2017
753
-
754
- #data collection
755
- data22=pd.read_excel("/content/ans21.xlsx")
756
- df22 = data22.drop([' YEAR '], axis=1)
757
-
758
-
759
-
760
- #data indexing
761
- x=df22.iloc[:,1:].values
762
- y=df22.iloc[:,0].values
763
- np.reshape(y,(-1,1))
764
-
765
- #split the dataset
766
- from sklearn.model_selection import train_test_split
767
- X_train, X_test, y_train, y_test = train_test_split(
768
- x, y, test_size=0.33, random_state=42)
769
-
770
-
771
- #traing the dataset
772
- from sklearn.linear_model import LinearRegression
773
-
774
- reg = LinearRegression().fit(X_train, y_train)
775
-
776
-
777
- y_pred22=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
778
-
779
-
780
-
781
-
782
-
783
- #Equation
784
- total22="-12.58553956 *(x1)+54.81099258*(x2)+224.41124874*(x3)+437.35226861*(x4)+(-160.78658794)*(x5)+68323.07737183299"
785
-
786
-
787
-
788
-
789
-
790
- #2018
791
-
792
- #data collection
793
- data23=pd.read_excel("/content/ans22.xlsx")
794
- df23 = data23.drop([' YEAR '], axis=1)
795
-
796
-
797
-
798
- #data indexing
799
- x=df23.iloc[:,1:].values
800
- y=df23.iloc[:,0].values
801
- np.reshape(y,(-1,1))
802
-
803
- #split the dataset
804
- from sklearn.model_selection import train_test_split
805
- X_train, X_test, y_train, y_test = train_test_split(
806
- x, y, test_size=0.33, random_state=42)
807
-
808
-
809
- #traing the dataset
810
- from sklearn.linear_model import LinearRegression
811
-
812
- reg = LinearRegression().fit(X_train, y_train)
813
-
814
-
815
- y_pred23=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
816
-
817
-
818
-
819
-
820
-
821
- #Equation
822
- total23="73.20314723*(x1)+158.24671048*(x2)+(-3876.80695302)*(x3)+356.25236863*(x4)+(-195.73184137)*(x5)+85757.9509512224"
823
-
824
-
825
-
826
-
827
- #2019
828
-
829
- #data collection
830
- data24=pd.read_excel("/content/ans23.xlsx")
831
- df24 = data24.drop([' YEAR '], axis=1)
832
-
833
-
834
-
835
- #data indexing
836
- x=df24.iloc[:,1:].values
837
- y=df24.iloc[:,0].values
838
- np.reshape(y,(-1,1))
839
-
840
- #split the dataset
841
- from sklearn.model_selection import train_test_split
842
- X_train, X_test, y_train, y_test = train_test_split(
843
- x, y, test_size=0.33, random_state=42)
844
-
845
-
846
- #traing the dataset
847
- from sklearn.linear_model import LinearRegression
848
-
849
- reg = LinearRegression().fit(X_train, y_train)
850
-
851
-
852
- y_pred24=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
853
-
854
-
855
-
856
-
857
-
858
- #Equation
859
- total24="104.06131346*(x1)+110.40576115*(x2)+(-3143.30201973)*(x3)+(-466.5687285)*(x4)+(-40.30732688)*(x5)+6946.199087391373"
860
-
861
-
862
-
863
-
864
-
865
- #2020
866
-
867
- #data collection
868
- data25=pd.read_excel("/content/ans24.xlsx")
869
- df25 = data25.drop([' YEAR '], axis=1)
870
-
871
-
872
-
873
- #data indexing
874
- x=df25.iloc[:,1:].values
875
- y=df25.iloc[:,0].values
876
- np.reshape(y,(-1,1))
877
-
878
- #split the dataset
879
- from sklearn.model_selection import train_test_split
880
- X_train, X_test, y_train, y_test = train_test_split(
881
- x, y, test_size=0.33, random_state=42)
882
-
883
-
884
- #traing the dataset
885
- from sklearn.linear_model import LinearRegression
886
-
887
- reg = LinearRegression().fit(X_train, y_train)
888
-
889
-
890
- y_pred25=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
891
-
892
-
893
-
894
-
895
-
896
- #Equation
897
- total25="22.78813682*(x1)+46.1536507*(x2)+78.00814512*(x3)+(-71.38031119)*(x4)+(-37.57839411)*(x5)+12559.184605195129"
898
-
899
-
900
-
901
-
902
-
903
- #2021
904
-
905
- #data collection
906
- data26=pd.read_excel("/content/ans25.xlsx")
907
- df26 = data26.drop([' YEAR '], axis=1)
908
-
909
-
910
-
911
- #data indexing
912
- x=df26.iloc[:,1:].values
913
- y=df26.iloc[:,0].values
914
- np.reshape(y,(-1,1))
915
-
916
- #split the dataset
917
- from sklearn.model_selection import train_test_split
918
- X_train, X_test, y_train, y_test = train_test_split(
919
- x, y, test_size=0.33, random_state=42)
920
-
921
-
922
- #traing the dataset
923
- from sklearn.linear_model import LinearRegression
924
-
925
- reg = LinearRegression().fit(X_train, y_train)
926
-
927
-
928
- y_pred26=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
929
-
930
-
931
-
932
-
933
-
934
- #Equation
935
- total26="63.70545758*(x1)+9.57432502*(x2)+1734.12898357*(x3)+(-230.53815238)*(x4)+93.1299683*(x5)-51860.81441391745"
936
-
937
-
938
-
939
-
940
-
941
- #2022
942
-
943
- #data collection
944
- data27=pd.read_excel("/content/ans26.xlsx")
945
- df27 = data27.drop([' YEAR '], axis=1)
946
-
947
-
948
-
949
- #data indexing
950
- x=df27.iloc[:,1:].values
951
- y=df27.iloc[:,0].values
952
- np.reshape(y,(-1,1))
953
-
954
- #split the dataset
955
- from sklearn.model_selection import train_test_split
956
- X_train, X_test, y_train, y_test = train_test_split(
957
- x, y, test_size=0.33, random_state=42)
958
-
959
-
960
- #traing the dataset
961
- from sklearn.linear_model import LinearRegression
962
-
963
- reg = LinearRegression().fit(X_train, y_train)
964
-
965
-
966
- y_pred27=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
967
-
968
-
969
-
970
 
971
-
972
- #Equation
973
- total27="15.98972327*(x1)+5568.67299429*(x2)+79.28661735*(x3)+16.79333316*(x4)+(-87.10169494)*(x5)+40155.32700035415"
974
 
975
 
976
 
@@ -982,83 +27,7 @@ def greet(year,co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emi
982
  if(year==1996):
983
  return total1,eq1
984
 
985
- elif(year==1997):
986
- return total2,y_pred2
987
-
988
- elif(year==1998):
989
- return total3,y_pred3
990
-
991
- elif(year==1999):
992
- return total4,y_pred4
993
-
994
- elif(year==2000):
995
- return total5,y_pred5
996
-
997
- elif(year==2001):
998
- return total6,y_pred6
999
-
1000
- elif(year==2002):
1001
- return total7,y_pred7
1002
-
1003
- elif(year==2003):
1004
- return total8,y_pred8
1005
-
1006
- elif(year==2004):
1007
- return total9,y_pred9
1008
-
1009
- elif(year==2005):
1010
- return total10,y_pred10
1011
-
1012
- elif(year==2006):
1013
- return total11,y_pred11
1014
-
1015
- elif(year==2007):
1016
- return total12,y_pred12
1017
-
1018
- elif(year==2008):
1019
- return total13,y_pred13
1020
-
1021
- elif(year==2009):
1022
- return total14,y_pred14
1023
-
1024
- elif(year==2010):
1025
- return total15,y_pred15
1026
-
1027
- elif(year==2011):
1028
- return total16,y_pred16
1029
-
1030
- elif(year==2012):
1031
- return total17,y_pred17
1032
-
1033
- elif(year==2013):
1034
- return total18,y_pred18
1035
-
1036
- elif(year==2014):
1037
- return total19,y_pred19
1038
-
1039
- elif(year==2015):
1040
- return total20,y_pred20
1041
-
1042
- elif(year==2016):
1043
- return total21,y_pred21
1044
-
1045
- elif(year==2017):
1046
- return total22,y_pred22
1047
-
1048
- elif(year==2018):
1049
- return total23,y_pred23
1050
-
1051
- elif(year==2019):
1052
- return total24,y_pred24
1053
-
1054
- elif(year==2020):
1055
- return total25,y_pred25
1056
-
1057
- elif(year==2021):
1058
- return total26,y_pred26
1059
-
1060
- elif(year==2022):
1061
- return total27,y_pred27
1062
 
1063
  else:
1064
  return "no",0
 
15
  eq1=2.29209688*(co2_emission)+(-17.24834114)*(No2_emission)+(-34.46449984)*(so2_emission)+441.88734541*(Global_Warming)+(-10.5704468)*(Methane_emission)+3032.3276611889232
16
 
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
 
 
 
19
 
20
 
21
 
 
27
  if(year==1996):
28
  return total1,eq1
29
 
30
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  else:
33
  return "no",0