I have a data which has 40 colums but i narrow it down:
Information = df[["Origin Airport", "Operating Airline Name", "Operating Airline Capacity"]]
Now it looks like this
Origin Airport ... Operating Airline Capacity
0 IAD ... 16151
1 IAD ... 12183
2 IAD ... 10974
3 IAD ... 8959
4 IAD ... 8587
... ... ... ...
23605 IAD ... 50
23606 IAD ... 50
23607 IAD ... 50
23608 IAD ... 50
23609 IAD ... 50
I want to make a dictionary with Operating Airline being the Key and capacity as the value.
a=Information.set_index('Operating Airline Name')['Operating Airline Capacity'].to_dict()
It works but when i examine the results it not matching with the actual results.
Printing "a" looks like this
{'Emirates': 16151, 'Ethiopian Airlines Enterprise': 1179, 'Qatar Airways (Q.C.S.C.)': 354, 'Turkish Airlines Inc.': 9300, 'Korean Air Lines Co. Ltd.': 8587, 'United Airlines, Inc.': 126, 'Air France': 296, 'Etihad Airways': 7006,
goes on..
For example there is multiple "Emirates" lines with different values in data but not in "a" dictionary
As a result, I want to have a dictionary that shows the sum of the capacity for each airline.
Any suggestions? Thanks!