samyakbayar commited on
Commit
e14708b
·
verified ·
1 Parent(s): 2c33bac

Upload world-airport-network dataset files

Browse files
Files changed (8) hide show
  1. KAGGLE.md +149 -0
  2. README.md +158 -0
  3. about.md +26 -0
  4. airports.csv +0 -0
  5. data_dictionary.csv +44 -0
  6. dataset-metadata.json +257 -0
  7. kernel-metadata.json +14 -0
  8. notebook.ipynb +213 -0
KAGGLE.md ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # World Airport Network
2
+
3
+ **Subtitle:** 7,698 airports with IATA/ICAO codes, coordinates and route graph statistics
4
+
5
+ **Tags:** `aviation`, `transportation`, `geospatial`, `networks`, `airports`, `travel`, `logistics`, `graph-analysis`, `tabular`, `economics`
6
+
7
+ **Dataset File:** `airports.csv` (7,698 rows, 43 columns, 1.9 MB)
8
+
9
+ ---
10
+
11
+ ## 📖 Description
12
+
13
+ ### The world's airports as a graph
14
+
15
+ OpenFlights maintains one of the most widely used open aviation registries. This dataset joins its
16
+ **airport directory** with its **airline route table** to describe **7,698 airports** in
17
+ 237 countries using **43 parameters** — including the network structure
18
+ that only appears once routes are aggregated.
19
+
20
+ Each row is one airport and contains:
21
+ - **Identity** — OpenFlights id, name, city, country, IATA and ICAO codes, facility type and data source.
22
+ - **Position** — latitude, longitude, elevation in feet, UTC offset, DST rule and IANA time zone.
23
+ - **Network degree** — departing and arriving route records, distinct airlines, distinct non-stop
24
+ destinations, foreign destinations, countries served, domestic versus international route counts and
25
+ the international share.
26
+ - **Dominant carrier** — the airline with the most routes at that airport and how many it runs.
27
+ - **Reach** — mean and maximum great-circle route distance, and the airport code of the longest hop.
28
+ - **Role** — a hub class derived from route count, from Isolated to Global hub.
29
+ - **Country context** — continent, UN region and sub-region, population, GDP per capita, distance to the
30
+ national capital, a near-capital flag, the number of airports in the country and routes per million people.
31
+
32
+ **7,698 of 7,698 records are scheduled-service airports**; about **3,262** have at least
33
+ one route in the airlines table, which makes the difference between "an airport exists" and "an airport is
34
+ connected" directly measurable.
35
+
36
+ ## 🧾 Columns (43)
37
+
38
+ `airport_id`, `name`, `city`, `country`, `iata`, `icao`, `latitude`, `longitude`, `altitude_ft`, `tz_offset_hours`, `dst`, `tz_database`, `type`, `source`, `continent`, `region`, `subregion`, `hemisphere`, `altitude_band`, `has_iata`, `is_scheduled_service`, `utc_offset_band`, `n_routes_out`, `n_routes_in`, `n_airlines`, `n_destinations`, `n_destinations_international`, `n_countries_served`, `n_domestic_routes`, `share_international_pct`, `top_airline`, `top_airline_routes`, `mean_route_distance_km`, `max_route_distance_km`, `farthest_destination`, `hub_class`, `capital_distance_km`, `is_near_capital`, `routes_per_million_people`, `country_population`, `country_gdp_per_capita_usd`, `airports_in_country`, `name_word_count`
39
+
40
+ ## 💡 Ideas for using this data
41
+
42
+ 1. **Airport ranking** — build a hub index from degree, destination count and international share.
43
+ 2. **Network analysis** — the route table implies a directed graph; compute centrality, communities and degree distributions from the per-airport aggregates.
44
+ 3. **Hub-and-spoke structure** — plot `n_destinations` against `n_airlines` to separate fortress hubs from diversified ones.
45
+ 4. **Long-haul geography** — map `max_route_distance_km`; which airports exist only because of ultra-long-haul aircraft?
46
+ 5. **Isolation** — find countries where many airports exist but almost none are connected.
47
+ 6. **Capital concentration** — `capital_distance_km` versus route count; how much traffic funnels through capital-city airports?
48
+ 7. **Aviation and wealth** — `routes_per_million_people` against GDP per capita.
49
+ 8. **Time zones** — airports per UTC offset band; where does the world's air traffic actually sit?
50
+ 9. **Classification** — predict `hub_class` from geography and country features.
51
+
52
+ ## 📁 Files
53
+
54
+ | File | What it is |
55
+ |---|---|
56
+ | `airports.csv` | 7,698 airports x 43 parameters, route-network enriched. |
57
+ | `data_dictionary.csv` | Column / type / description for every field. |
58
+ | `notebook.ipynb` | Starter notebook: hub ranking, long-haul map, wealth vs connectivity. |
59
+ | `dataset-metadata.json` | Kaggle API metadata. |
60
+ | `about.md` | Plain-text About block. |
61
+
62
+ ## 🏷️ Tags
63
+
64
+ `aviation`, `transportation`, `geospatial`, `networks`, `airports`, `travel`, `logistics`, `graph-analysis`, `tabular`, `economics`
65
+
66
+ ## 🔗 Provenance
67
+
68
+ - **Source:** **OpenFlights** open data, `airports.dat` and `routes.dat`
69
+ (`github.com/jpatokal/openflights/data`). Airport records ultimately derive from OurAirports and DAFIF;
70
+ route records are contributed by airlines and the OpenFlights community.
71
+ - **Licence of the upstream files:** Open Database License (ODbL) 1.0.
72
+ - **Transformation:** airport rows reshaped into 14 named columns; the route table aggregated per airport
73
+ to produce degree, destination, airline, distance and domestic/international statistics.
74
+ - **Enrichment:** country population, GDP per capita, capital coordinates and UN regions joined from the
75
+ World Bank-backed `countries-of-the-world` table in this repository by country name.
76
+ - **Snapshot date:** 20 November 2026.
77
+
78
+ ## 🔄 Update frequency
79
+
80
+ **Never (static snapshot).** OpenFlights is largely frozen upstream; the network statistics here reflect the route table as of the snapshot date.
81
+
82
+ ## ⚠️ Caveats
83
+
84
+ - Route coverage is community-maintained and uneven: some regions (notably parts of Africa and Central Asia) are under-reported.
85
+ - `\N` marks a missing IATA/ICAO code and is preserved rather than blanked so it can be filtered explicitly.
86
+ - Routes are counted as records in `routes.dat`; a route operated by three airlines counts three times.
87
+ - The country join is by name, so a few territories (e.g. 'Hong Kong', 'Macau') may not match a World Bank entity.
88
+ - Distances are great-circle, not flown track distances.
89
+ - The file is a snapshot of schedules, not of passenger volumes — no traffic or seat-capacity figures are included.
90
+
91
+ ## 📜 Licence
92
+
93
+ Open Database License (ODbL) 1.0 for the OpenFlights airport and route data. Derived statistics may be shared under the same terms; attribution to OpenFlights and OurAirports is required.
94
+
95
+ ### 📋 Column Definitions & File Header
96
+
97
+ | # | Column Name | Data Type | Description |
98
+ |---|---|---|---|
99
+ | 1 | `airport_id` | `number` | OpenFlights airport identifier. |
100
+ | 2 | `name` | `string` | Airport name. |
101
+ | 3 | `city` | `string` | City served. |
102
+ | 4 | `country` | `string` | Country name as recorded by OpenFlights. |
103
+ | 5 | `iata` | `string` | 3-letter IATA code (\N when unassigned). |
104
+ | 6 | `icao` | `string` | 4-letter ICAO code (\N when unassigned). |
105
+ | 7 | `latitude` | `number` | Latitude in decimal degrees. |
106
+ | 8 | `longitude` | `number` | Longitude in decimal degrees. |
107
+ | 9 | `altitude_ft` | `number` | Elevation above sea level in feet. |
108
+ | 10 | `tz_offset_hours` | `number` | UTC offset in hours (fractional where applicable). |
109
+ | 11 | `dst` | `string` | Daylight-saving-time rule letter used by OpenFlights. |
110
+ | 12 | `tz_database` | `string` | IANA time-zone name. |
111
+ | 13 | `type` | `string` | Facility type: airport, heliport, seaplane base, closed. |
112
+ | 14 | `source` | `string` | Upstream data source for the record. |
113
+ | 15 | `continent` | `string` | Continent of the airport's country. |
114
+ | 16 | `region` | `string` | UN macro-region of the airport's country. |
115
+ | 17 | `subregion` | `string` | UN sub-region of the airport's country. |
116
+ | 18 | `hemisphere` | `string` | Northern or Southern hemisphere. |
117
+ | 19 | `altitude_band` | `string` | Elevation band from sea level to high plateau. |
118
+ | 20 | `has_iata` | `boolean` | true when the airport has an IATA code (i.e. is commercially ticketed). |
119
+ | 21 | `is_scheduled_service` | `boolean` | true for records typed `airport` (as opposed to heliport, seaplane base, closed). |
120
+ | 22 | `utc_offset_band` | `number` | UTC offset rounded to the nearest whole hour. |
121
+ | 23 | `n_routes_out` | `number` | Number of scheduled route records departing this airport. |
122
+ | 24 | `n_routes_in` | `number` | Number of scheduled route records arriving at this airport. |
123
+ | 25 | `n_airlines` | `number` | Distinct airlines operating to or from the airport. |
124
+ | 26 | `n_destinations` | `number` | Distinct airports reachable in one non-stop hop. |
125
+ | 27 | `n_destinations_international` | `number` | Distinct destination airports outside the airport's own country. |
126
+ | 28 | `n_countries_served` | `number` | Distinct foreign countries reachable non-stop. |
127
+ | 29 | `n_domestic_routes` | `number` | Route records whose origin and destination are in the same country. |
128
+ | 30 | `share_international_pct` | `number` | Percentage of this airport's route records that cross a border. |
129
+ | 31 | `top_airline` | `string` | Airline with the most route records at this airport. |
130
+ | 32 | `top_airline_routes` | `number` | Route records operated by that airline. |
131
+ | 33 | `mean_route_distance_km` | `number` | Mean great-circle distance of this airport's routes. |
132
+ | 34 | `max_route_distance_km` | `number` | Longest non-stop route from this airport. |
133
+ | 35 | `farthest_destination` | `string` | Airport code of that longest route. |
134
+ | 36 | `hub_class` | `string` | Network role from route count: Isolated, Feeder, Regional, Major, Global hub. |
135
+ | 37 | `capital_distance_km` | `string` | Great-circle distance to the country's capital city. |
136
+ | 38 | `is_near_capital` | `string` | true when the airport is within 40 km of its country's capital. |
137
+ | 39 | `routes_per_million_people` | `number` | Route records divided by country population in millions. |
138
+ | 40 | `country_population` | `number` | Country population (World Bank, joined). |
139
+ | 41 | `country_gdp_per_capita_usd` | `number` | Country GDP per capita (World Bank, joined). |
140
+ | 42 | `airports_in_country` | `number` | Number of airports in this file for the same country. |
141
+ | 43 | `name_word_count` | `number` | Number of words in the airport name. |
142
+
143
+
144
+
145
+ ---
146
+
147
+ ## 🌟 Support & Community
148
+ If you find this dataset valuable for your research, portfolio, or machine learning projects, **please give it an upvote (👍) on Kaggle!**
149
+ Feedback, questions, and notebook submissions are warmly welcomed in the Discussions tab.
README.md ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - tabular-classification
5
+ tags:
6
+ - tabular
7
+ pretty_name: World Airport Network
8
+ ---
9
+
10
+ # World Airport Network
11
+
12
+ **Subtitle:** 7,698 airports with IATA/ICAO codes, coordinates and route graph statistics
13
+
14
+ **Tags:** `aviation`, `transportation`, `geospatial`, `networks`, `airports`, `travel`, `logistics`, `graph-analysis`, `tabular`, `economics`
15
+
16
+ **Dataset File:** `airports.csv` (7,698 rows, 43 columns, 1.9 MB)
17
+
18
+ ---
19
+
20
+ ## 📖 Description
21
+
22
+ ### The world's airports as a graph
23
+
24
+ OpenFlights maintains one of the most widely used open aviation registries. This dataset joins its
25
+ **airport directory** with its **airline route table** to describe **7,698 airports** in
26
+ 237 countries using **43 parameters** — including the network structure
27
+ that only appears once routes are aggregated.
28
+
29
+ Each row is one airport and contains:
30
+ - **Identity** — OpenFlights id, name, city, country, IATA and ICAO codes, facility type and data source.
31
+ - **Position** — latitude, longitude, elevation in feet, UTC offset, DST rule and IANA time zone.
32
+ - **Network degree** — departing and arriving route records, distinct airlines, distinct non-stop
33
+ destinations, foreign destinations, countries served, domestic versus international route counts and
34
+ the international share.
35
+ - **Dominant carrier** — the airline with the most routes at that airport and how many it runs.
36
+ - **Reach** — mean and maximum great-circle route distance, and the airport code of the longest hop.
37
+ - **Role** — a hub class derived from route count, from Isolated to Global hub.
38
+ - **Country context** — continent, UN region and sub-region, population, GDP per capita, distance to the
39
+ national capital, a near-capital flag, the number of airports in the country and routes per million people.
40
+
41
+ **7,698 of 7,698 records are scheduled-service airports**; about **3,262** have at least
42
+ one route in the airlines table, which makes the difference between "an airport exists" and "an airport is
43
+ connected" directly measurable.
44
+
45
+ ## 🧾 Columns (43)
46
+
47
+ `airport_id`, `name`, `city`, `country`, `iata`, `icao`, `latitude`, `longitude`, `altitude_ft`, `tz_offset_hours`, `dst`, `tz_database`, `type`, `source`, `continent`, `region`, `subregion`, `hemisphere`, `altitude_band`, `has_iata`, `is_scheduled_service`, `utc_offset_band`, `n_routes_out`, `n_routes_in`, `n_airlines`, `n_destinations`, `n_destinations_international`, `n_countries_served`, `n_domestic_routes`, `share_international_pct`, `top_airline`, `top_airline_routes`, `mean_route_distance_km`, `max_route_distance_km`, `farthest_destination`, `hub_class`, `capital_distance_km`, `is_near_capital`, `routes_per_million_people`, `country_population`, `country_gdp_per_capita_usd`, `airports_in_country`, `name_word_count`
48
+
49
+ ## 💡 Ideas for using this data
50
+
51
+ 1. **Airport ranking** — build a hub index from degree, destination count and international share.
52
+ 2. **Network analysis** — the route table implies a directed graph; compute centrality, communities and degree distributions from the per-airport aggregates.
53
+ 3. **Hub-and-spoke structure** — plot `n_destinations` against `n_airlines` to separate fortress hubs from diversified ones.
54
+ 4. **Long-haul geography** — map `max_route_distance_km`; which airports exist only because of ultra-long-haul aircraft?
55
+ 5. **Isolation** — find countries where many airports exist but almost none are connected.
56
+ 6. **Capital concentration** — `capital_distance_km` versus route count; how much traffic funnels through capital-city airports?
57
+ 7. **Aviation and wealth** — `routes_per_million_people` against GDP per capita.
58
+ 8. **Time zones** — airports per UTC offset band; where does the world's air traffic actually sit?
59
+ 9. **Classification** — predict `hub_class` from geography and country features.
60
+
61
+ ## 📁 Files
62
+
63
+ | File | What it is |
64
+ |---|---|
65
+ | `airports.csv` | 7,698 airports x 43 parameters, route-network enriched. |
66
+ | `data_dictionary.csv` | Column / type / description for every field. |
67
+ | `notebook.ipynb` | Starter notebook: hub ranking, long-haul map, wealth vs connectivity. |
68
+ | `dataset-metadata.json` | Kaggle API metadata. |
69
+ | `about.md` | Plain-text About block. |
70
+
71
+ ## 🏷️ Tags
72
+
73
+ `aviation`, `transportation`, `geospatial`, `networks`, `airports`, `travel`, `logistics`, `graph-analysis`, `tabular`, `economics`
74
+
75
+ ## 🔗 Provenance
76
+
77
+ - **Source:** **OpenFlights** open data, `airports.dat` and `routes.dat`
78
+ (`github.com/jpatokal/openflights/data`). Airport records ultimately derive from OurAirports and DAFIF;
79
+ route records are contributed by airlines and the OpenFlights community.
80
+ - **Licence of the upstream files:** Open Database License (ODbL) 1.0.
81
+ - **Transformation:** airport rows reshaped into 14 named columns; the route table aggregated per airport
82
+ to produce degree, destination, airline, distance and domestic/international statistics.
83
+ - **Enrichment:** country population, GDP per capita, capital coordinates and UN regions joined from the
84
+ World Bank-backed `countries-of-the-world` table in this repository by country name.
85
+ - **Snapshot date:** 20 November 2026.
86
+
87
+ ## 🔄 Update frequency
88
+
89
+ **Never (static snapshot).** OpenFlights is largely frozen upstream; the network statistics here reflect the route table as of the snapshot date.
90
+
91
+ ## ⚠️ Caveats
92
+
93
+ - Route coverage is community-maintained and uneven: some regions (notably parts of Africa and Central Asia) are under-reported.
94
+ - `\N` marks a missing IATA/ICAO code and is preserved rather than blanked so it can be filtered explicitly.
95
+ - Routes are counted as records in `routes.dat`; a route operated by three airlines counts three times.
96
+ - The country join is by name, so a few territories (e.g. 'Hong Kong', 'Macau') may not match a World Bank entity.
97
+ - Distances are great-circle, not flown track distances.
98
+ - The file is a snapshot of schedules, not of passenger volumes — no traffic or seat-capacity figures are included.
99
+
100
+ ## 📜 Licence
101
+
102
+ Open Database License (ODbL) 1.0 for the OpenFlights airport and route data. Derived statistics may be shared under the same terms; attribution to OpenFlights and OurAirports is required.
103
+
104
+ ### 📋 Column Definitions & File Header
105
+
106
+ | # | Column Name | Data Type | Description |
107
+ |---|---|---|---|
108
+ | 1 | `airport_id` | `number` | OpenFlights airport identifier. |
109
+ | 2 | `name` | `string` | Airport name. |
110
+ | 3 | `city` | `string` | City served. |
111
+ | 4 | `country` | `string` | Country name as recorded by OpenFlights. |
112
+ | 5 | `iata` | `string` | 3-letter IATA code (\N when unassigned). |
113
+ | 6 | `icao` | `string` | 4-letter ICAO code (\N when unassigned). |
114
+ | 7 | `latitude` | `number` | Latitude in decimal degrees. |
115
+ | 8 | `longitude` | `number` | Longitude in decimal degrees. |
116
+ | 9 | `altitude_ft` | `number` | Elevation above sea level in feet. |
117
+ | 10 | `tz_offset_hours` | `number` | UTC offset in hours (fractional where applicable). |
118
+ | 11 | `dst` | `string` | Daylight-saving-time rule letter used by OpenFlights. |
119
+ | 12 | `tz_database` | `string` | IANA time-zone name. |
120
+ | 13 | `type` | `string` | Facility type: airport, heliport, seaplane base, closed. |
121
+ | 14 | `source` | `string` | Upstream data source for the record. |
122
+ | 15 | `continent` | `string` | Continent of the airport's country. |
123
+ | 16 | `region` | `string` | UN macro-region of the airport's country. |
124
+ | 17 | `subregion` | `string` | UN sub-region of the airport's country. |
125
+ | 18 | `hemisphere` | `string` | Northern or Southern hemisphere. |
126
+ | 19 | `altitude_band` | `string` | Elevation band from sea level to high plateau. |
127
+ | 20 | `has_iata` | `boolean` | true when the airport has an IATA code (i.e. is commercially ticketed). |
128
+ | 21 | `is_scheduled_service` | `boolean` | true for records typed `airport` (as opposed to heliport, seaplane base, closed). |
129
+ | 22 | `utc_offset_band` | `number` | UTC offset rounded to the nearest whole hour. |
130
+ | 23 | `n_routes_out` | `number` | Number of scheduled route records departing this airport. |
131
+ | 24 | `n_routes_in` | `number` | Number of scheduled route records arriving at this airport. |
132
+ | 25 | `n_airlines` | `number` | Distinct airlines operating to or from the airport. |
133
+ | 26 | `n_destinations` | `number` | Distinct airports reachable in one non-stop hop. |
134
+ | 27 | `n_destinations_international` | `number` | Distinct destination airports outside the airport's own country. |
135
+ | 28 | `n_countries_served` | `number` | Distinct foreign countries reachable non-stop. |
136
+ | 29 | `n_domestic_routes` | `number` | Route records whose origin and destination are in the same country. |
137
+ | 30 | `share_international_pct` | `number` | Percentage of this airport's route records that cross a border. |
138
+ | 31 | `top_airline` | `string` | Airline with the most route records at this airport. |
139
+ | 32 | `top_airline_routes` | `number` | Route records operated by that airline. |
140
+ | 33 | `mean_route_distance_km` | `number` | Mean great-circle distance of this airport's routes. |
141
+ | 34 | `max_route_distance_km` | `number` | Longest non-stop route from this airport. |
142
+ | 35 | `farthest_destination` | `string` | Airport code of that longest route. |
143
+ | 36 | `hub_class` | `string` | Network role from route count: Isolated, Feeder, Regional, Major, Global hub. |
144
+ | 37 | `capital_distance_km` | `string` | Great-circle distance to the country's capital city. |
145
+ | 38 | `is_near_capital` | `string` | true when the airport is within 40 km of its country's capital. |
146
+ | 39 | `routes_per_million_people` | `number` | Route records divided by country population in millions. |
147
+ | 40 | `country_population` | `number` | Country population (World Bank, joined). |
148
+ | 41 | `country_gdp_per_capita_usd` | `number` | Country GDP per capita (World Bank, joined). |
149
+ | 42 | `airports_in_country` | `number` | Number of airports in this file for the same country. |
150
+ | 43 | `name_word_count` | `number` | Number of words in the airport name. |
151
+
152
+
153
+
154
+ ---
155
+
156
+ ## 🌟 Support & Community
157
+ If you find this dataset valuable for your research, portfolio, or machine learning projects, **please give it an upvote (👍) on Kaggle!**
158
+ Feedback, questions, and notebook submissions are warmly welcomed in the Discussions tab.
about.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ World Airport Network
2
+
3
+ ### The world's airports as a graph
4
+
5
+ OpenFlights maintains one of the most widely used open aviation registries. This dataset joins its
6
+ **airport directory** with its **airline route table** to describe **7,698 airports** in
7
+ 237 countries using **43 parameters** — including the network structure
8
+ that only appears once routes are aggregated.
9
+
10
+ Each row is one airport and contains:
11
+ - **Identity** — OpenFlights id, name, city, country, IATA and ICAO codes, facility type and data source.
12
+ - **Position** — latitude, longitude, elevation in feet, UTC offset, DST rule and IANA time zone.
13
+ - **Network degree** — departing and arriving route records, distinct airlines, distinct non-stop
14
+ destinations, foreign destinations, countries served, domestic versus international route counts and
15
+ the international share.
16
+ - **Dominant carrier** — the airline with the most routes at that airport and how many it runs.
17
+ - **Reach** — mean and maximum great-circle route distance, and the airport code of the longest hop.
18
+ - **Role** — a hub class derived from route count, from Isolated to Global hub.
19
+ - **Country context** — continent, UN region and sub-region, population, GDP per capita, distance to the
20
+ national capital, a near-capital flag, the number of airports in the country and routes per million people.
21
+
22
+ **7,698 of 7,698 records are scheduled-service airports**; about **3,262** have at least
23
+ one route in the airlines table, which makes the difference between "an airport exists" and "an airport is
24
+ connected" directly measurable.
25
+
26
+ 43 columns; one row per airport.
airports.csv ADDED
The diff for this file is too large to render. See raw diff
 
data_dictionary.csv ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ column,data_type,description
2
+ airport_id,number,OpenFlights airport identifier.
3
+ name,string,Airport name.
4
+ city,string,City served.
5
+ country,string,Country name as recorded by OpenFlights.
6
+ iata,string,3-letter IATA code (\N when unassigned).
7
+ icao,string,4-letter ICAO code (\N when unassigned).
8
+ latitude,number,Latitude in decimal degrees.
9
+ longitude,number,Longitude in decimal degrees.
10
+ altitude_ft,number,Elevation above sea level in feet.
11
+ tz_offset_hours,number,UTC offset in hours (fractional where applicable).
12
+ dst,string,Daylight-saving-time rule letter used by OpenFlights.
13
+ tz_database,string,IANA time-zone name.
14
+ type,string,"Facility type: airport, heliport, seaplane base, closed."
15
+ source,string,Upstream data source for the record.
16
+ continent,string,Continent of the airport's country.
17
+ region,string,UN macro-region of the airport's country.
18
+ subregion,string,UN sub-region of the airport's country.
19
+ hemisphere,string,Northern or Southern hemisphere.
20
+ altitude_band,string,Elevation band from sea level to high plateau.
21
+ has_iata,boolean,true when the airport has an IATA code (i.e. is commercially ticketed).
22
+ is_scheduled_service,boolean,"true for records typed `airport` (as opposed to heliport, seaplane base, closed)."
23
+ utc_offset_band,number,UTC offset rounded to the nearest whole hour.
24
+ n_routes_out,number,Number of scheduled route records departing this airport.
25
+ n_routes_in,number,Number of scheduled route records arriving at this airport.
26
+ n_airlines,number,Distinct airlines operating to or from the airport.
27
+ n_destinations,number,Distinct airports reachable in one non-stop hop.
28
+ n_destinations_international,number,Distinct destination airports outside the airport's own country.
29
+ n_countries_served,number,Distinct foreign countries reachable non-stop.
30
+ n_domestic_routes,number,Route records whose origin and destination are in the same country.
31
+ share_international_pct,number,Percentage of this airport's route records that cross a border.
32
+ top_airline,string,Airline with the most route records at this airport.
33
+ top_airline_routes,number,Route records operated by that airline.
34
+ mean_route_distance_km,number,Mean great-circle distance of this airport's routes.
35
+ max_route_distance_km,number,Longest non-stop route from this airport.
36
+ farthest_destination,string,Airport code of that longest route.
37
+ hub_class,string,"Network role from route count: Isolated, Feeder, Regional, Major, Global hub."
38
+ capital_distance_km,string,Great-circle distance to the country's capital city.
39
+ is_near_capital,string,true when the airport is within 40 km of its country's capital.
40
+ routes_per_million_people,number,Route records divided by country population in millions.
41
+ country_population,number,"Country population (World Bank, joined)."
42
+ country_gdp_per_capita_usd,number,"Country GDP per capita (World Bank, joined)."
43
+ airports_in_country,number,Number of airports in this file for the same country.
44
+ name_word_count,number,Number of words in the airport name.
dataset-metadata.json ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "title": "World Airport Network",
3
+ "id": "samyakrajbayar/world-airport-network",
4
+ "subtitle": "7,698 airports with IATA/ICAO codes, coordinates and route graph statistics",
5
+ "description": "# World Airport Network\n\n**Subtitle:** 7,698 airports with IATA/ICAO codes, coordinates and route graph statistics\n\n**Tags:** `aviation`, `transportation`, `geospatial`, `networks`, `airports`, `travel`, `logistics`, `graph-analysis`, `tabular`, `economics`\n\n**Dataset File:** `airports.csv` (7,698 rows, 43 columns, 1.9 MB)\n\n---\n\n## \ud83d\udcd6 Description\n\n### The world's airports as a graph\n\nOpenFlights maintains one of the most widely used open aviation registries. This dataset joins its\n**airport directory** with its **airline route table** to describe **7,698 airports** in\n237 countries using **43 parameters** \u2014 including the network structure\nthat only appears once routes are aggregated.\n\nEach row is one airport and contains:\n- **Identity** \u2014 OpenFlights id, name, city, country, IATA and ICAO codes, facility type and data source.\n- **Position** \u2014 latitude, longitude, elevation in feet, UTC offset, DST rule and IANA time zone.\n- **Network degree** \u2014 departing and arriving route records, distinct airlines, distinct non-stop\n destinations, foreign destinations, countries served, domestic versus international route counts and\n the international share.\n- **Dominant carrier** \u2014 the airline with the most routes at that airport and how many it runs.\n- **Reach** \u2014 mean and maximum great-circle route distance, and the airport code of the longest hop.\n- **Role** \u2014 a hub class derived from route count, from Isolated to Global hub.\n- **Country context** \u2014 continent, UN region and sub-region, population, GDP per capita, distance to the\n national capital, a near-capital flag, the number of airports in the country and routes per million people.\n\n**7,698 of 7,698 records are scheduled-service airports**; about **3,262** have at least\none route in the airlines table, which makes the difference between \"an airport exists\" and \"an airport is\nconnected\" directly measurable.\n\n## \ud83e\uddfe Columns (43)\n\n`airport_id`, `name`, `city`, `country`, `iata`, `icao`, `latitude`, `longitude`, `altitude_ft`, `tz_offset_hours`, `dst`, `tz_database`, `type`, `source`, `continent`, `region`, `subregion`, `hemisphere`, `altitude_band`, `has_iata`, `is_scheduled_service`, `utc_offset_band`, `n_routes_out`, `n_routes_in`, `n_airlines`, `n_destinations`, `n_destinations_international`, `n_countries_served`, `n_domestic_routes`, `share_international_pct`, `top_airline`, `top_airline_routes`, `mean_route_distance_km`, `max_route_distance_km`, `farthest_destination`, `hub_class`, `capital_distance_km`, `is_near_capital`, `routes_per_million_people`, `country_population`, `country_gdp_per_capita_usd`, `airports_in_country`, `name_word_count`\n\n## \ud83d\udca1 Ideas for using this data\n\n1. **Airport ranking** \u2014 build a hub index from degree, destination count and international share.\n2. **Network analysis** \u2014 the route table implies a directed graph; compute centrality, communities and degree distributions from the per-airport aggregates.\n3. **Hub-and-spoke structure** \u2014 plot `n_destinations` against `n_airlines` to separate fortress hubs from diversified ones.\n4. **Long-haul geography** \u2014 map `max_route_distance_km`; which airports exist only because of ultra-long-haul aircraft?\n5. **Isolation** \u2014 find countries where many airports exist but almost none are connected.\n6. **Capital concentration** \u2014 `capital_distance_km` versus route count; how much traffic funnels through capital-city airports?\n7. **Aviation and wealth** \u2014 `routes_per_million_people` against GDP per capita.\n8. **Time zones** \u2014 airports per UTC offset band; where does the world's air traffic actually sit?\n9. **Classification** \u2014 predict `hub_class` from geography and country features.\n\n## \ud83d\udcc1 Files\n\n| File | What it is |\n|---|---|\n| `airports.csv` | 7,698 airports x 43 parameters, route-network enriched. |\n| `data_dictionary.csv` | Column / type / description for every field. |\n| `notebook.ipynb` | Starter notebook: hub ranking, long-haul map, wealth vs connectivity. |\n| `dataset-metadata.json` | Kaggle API metadata. |\n| `about.md` | Plain-text About block. |\n\n## \ud83c\udff7\ufe0f Tags\n\n`aviation`, `transportation`, `geospatial`, `networks`, `airports`, `travel`, `logistics`, `graph-analysis`, `tabular`, `economics`\n\n## \ud83d\udd17 Provenance\n\n- **Source:** **OpenFlights** open data, `airports.dat` and `routes.dat`\n (`github.com/jpatokal/openflights/data`). Airport records ultimately derive from OurAirports and DAFIF;\n route records are contributed by airlines and the OpenFlights community.\n- **Licence of the upstream files:** Open Database License (ODbL) 1.0.\n- **Transformation:** airport rows reshaped into 14 named columns; the route table aggregated per airport\n to produce degree, destination, airline, distance and domestic/international statistics.\n- **Enrichment:** country population, GDP per capita, capital coordinates and UN regions joined from the\n World Bank-backed `countries-of-the-world` table in this repository by country name.\n- **Snapshot date:** 20 November 2026.\n\n## \ud83d\udd04 Update frequency\n\n**Never (static snapshot).** OpenFlights is largely frozen upstream; the network statistics here reflect the route table as of the snapshot date.\n\n## \u26a0\ufe0f Caveats\n\n- Route coverage is community-maintained and uneven: some regions (notably parts of Africa and Central Asia) are under-reported.\n- `\\N` marks a missing IATA/ICAO code and is preserved rather than blanked so it can be filtered explicitly.\n- Routes are counted as records in `routes.dat`; a route operated by three airlines counts three times.\n- The country join is by name, so a few territories (e.g. 'Hong Kong', 'Macau') may not match a World Bank entity.\n- Distances are great-circle, not flown track distances.\n- The file is a snapshot of schedules, not of passenger volumes \u2014 no traffic or seat-capacity figures are included.\n\n## \ud83d\udcdc Licence\n\nOpen Database License (ODbL) 1.0 for the OpenFlights airport and route data. Derived statistics may be shared under the same terms; attribution to OpenFlights and OurAirports is required.\n\n### \ud83d\udccb Column Definitions & File Header\n\n| # | Column Name | Data Type | Description |\n|---|---|---|---|\n| 1 | `airport_id` | `number` | OpenFlights airport identifier. |\n| 2 | `name` | `string` | Airport name. |\n| 3 | `city` | `string` | City served. |\n| 4 | `country` | `string` | Country name as recorded by OpenFlights. |\n| 5 | `iata` | `string` | 3-letter IATA code (\\N when unassigned). |\n| 6 | `icao` | `string` | 4-letter ICAO code (\\N when unassigned). |\n| 7 | `latitude` | `number` | Latitude in decimal degrees. |\n| 8 | `longitude` | `number` | Longitude in decimal degrees. |\n| 9 | `altitude_ft` | `number` | Elevation above sea level in feet. |\n| 10 | `tz_offset_hours` | `number` | UTC offset in hours (fractional where applicable). |\n| 11 | `dst` | `string` | Daylight-saving-time rule letter used by OpenFlights. |\n| 12 | `tz_database` | `string` | IANA time-zone name. |\n| 13 | `type` | `string` | Facility type: airport, heliport, seaplane base, closed. |\n| 14 | `source` | `string` | Upstream data source for the record. |\n| 15 | `continent` | `string` | Continent of the airport's country. |\n| 16 | `region` | `string` | UN macro-region of the airport's country. |\n| 17 | `subregion` | `string` | UN sub-region of the airport's country. |\n| 18 | `hemisphere` | `string` | Northern or Southern hemisphere. |\n| 19 | `altitude_band` | `string` | Elevation band from sea level to high plateau. |\n| 20 | `has_iata` | `boolean` | true when the airport has an IATA code (i.e. is commercially ticketed). |\n| 21 | `is_scheduled_service` | `boolean` | true for records typed `airport` (as opposed to heliport, seaplane base, closed). |\n| 22 | `utc_offset_band` | `number` | UTC offset rounded to the nearest whole hour. |\n| 23 | `n_routes_out` | `number` | Number of scheduled route records departing this airport. |\n| 24 | `n_routes_in` | `number` | Number of scheduled route records arriving at this airport. |\n| 25 | `n_airlines` | `number` | Distinct airlines operating to or from the airport. |\n| 26 | `n_destinations` | `number` | Distinct airports reachable in one non-stop hop. |\n| 27 | `n_destinations_international` | `number` | Distinct destination airports outside the airport's own country. |\n| 28 | `n_countries_served` | `number` | Distinct foreign countries reachable non-stop. |\n| 29 | `n_domestic_routes` | `number` | Route records whose origin and destination are in the same country. |\n| 30 | `share_international_pct` | `number` | Percentage of this airport's route records that cross a border. |\n| 31 | `top_airline` | `string` | Airline with the most route records at this airport. |\n| 32 | `top_airline_routes` | `number` | Route records operated by that airline. |\n| 33 | `mean_route_distance_km` | `number` | Mean great-circle distance of this airport's routes. |\n| 34 | `max_route_distance_km` | `number` | Longest non-stop route from this airport. |\n| 35 | `farthest_destination` | `string` | Airport code of that longest route. |\n| 36 | `hub_class` | `string` | Network role from route count: Isolated, Feeder, Regional, Major, Global hub. |\n| 37 | `capital_distance_km` | `string` | Great-circle distance to the country's capital city. |\n| 38 | `is_near_capital` | `string` | true when the airport is within 40 km of its country's capital. |\n| 39 | `routes_per_million_people` | `number` | Route records divided by country population in millions. |\n| 40 | `country_population` | `number` | Country population (World Bank, joined). |\n| 41 | `country_gdp_per_capita_usd` | `number` | Country GDP per capita (World Bank, joined). |\n| 42 | `airports_in_country` | `number` | Number of airports in this file for the same country. |\n| 43 | `name_word_count` | `number` | Number of words in the airport name. |\n\n\n\n---\n\n## \ud83c\udf1f Support & Community\nIf you find this dataset valuable for your research, portfolio, or machine learning projects, **please give it an upvote (\ud83d\udc4d) on Kaggle!**\nFeedback, questions, and notebook submissions are warmly welcomed in the Discussions tab.\n",
6
+ "isPrivate": false,
7
+ "licenses": [
8
+ {
9
+ "name": "ODbL-1.0"
10
+ }
11
+ ],
12
+ "keywords": [
13
+ "aviation",
14
+ "transportation",
15
+ "geospatial",
16
+ "networks",
17
+ "airports",
18
+ "travel",
19
+ "logistics",
20
+ "graph-analysis",
21
+ "tabular",
22
+ "economics"
23
+ ],
24
+ "resources": [
25
+ {
26
+ "path": "airports.csv",
27
+ "description": "Primary data file containing 7,698 records across 43 parameters.",
28
+ "schema": {
29
+ "fields": [
30
+ {
31
+ "name": "airport_id",
32
+ "type": "number",
33
+ "description": "OpenFlights airport identifier."
34
+ },
35
+ {
36
+ "name": "name",
37
+ "type": "string",
38
+ "description": "Airport name."
39
+ },
40
+ {
41
+ "name": "city",
42
+ "type": "string",
43
+ "description": "City served."
44
+ },
45
+ {
46
+ "name": "country",
47
+ "type": "string",
48
+ "description": "Country name as recorded by OpenFlights."
49
+ },
50
+ {
51
+ "name": "iata",
52
+ "type": "string",
53
+ "description": "3-letter IATA code (\\N when unassigned)."
54
+ },
55
+ {
56
+ "name": "icao",
57
+ "type": "string",
58
+ "description": "4-letter ICAO code (\\N when unassigned)."
59
+ },
60
+ {
61
+ "name": "latitude",
62
+ "type": "number",
63
+ "description": "Latitude in decimal degrees."
64
+ },
65
+ {
66
+ "name": "longitude",
67
+ "type": "number",
68
+ "description": "Longitude in decimal degrees."
69
+ },
70
+ {
71
+ "name": "altitude_ft",
72
+ "type": "number",
73
+ "description": "Elevation above sea level in feet."
74
+ },
75
+ {
76
+ "name": "tz_offset_hours",
77
+ "type": "number",
78
+ "description": "UTC offset in hours (fractional where applicable)."
79
+ },
80
+ {
81
+ "name": "dst",
82
+ "type": "string",
83
+ "description": "Daylight-saving-time rule letter used by OpenFlights."
84
+ },
85
+ {
86
+ "name": "tz_database",
87
+ "type": "string",
88
+ "description": "IANA time-zone name."
89
+ },
90
+ {
91
+ "name": "type",
92
+ "type": "string",
93
+ "description": "Facility type: airport, heliport, seaplane base, closed."
94
+ },
95
+ {
96
+ "name": "source",
97
+ "type": "string",
98
+ "description": "Upstream data source for the record."
99
+ },
100
+ {
101
+ "name": "continent",
102
+ "type": "string",
103
+ "description": "Continent of the airport's country."
104
+ },
105
+ {
106
+ "name": "region",
107
+ "type": "string",
108
+ "description": "UN macro-region of the airport's country."
109
+ },
110
+ {
111
+ "name": "subregion",
112
+ "type": "string",
113
+ "description": "UN sub-region of the airport's country."
114
+ },
115
+ {
116
+ "name": "hemisphere",
117
+ "type": "string",
118
+ "description": "Northern or Southern hemisphere."
119
+ },
120
+ {
121
+ "name": "altitude_band",
122
+ "type": "string",
123
+ "description": "Elevation band from sea level to high plateau."
124
+ },
125
+ {
126
+ "name": "has_iata",
127
+ "type": "boolean",
128
+ "description": "true when the airport has an IATA code (i.e. is commercially ticketed)."
129
+ },
130
+ {
131
+ "name": "is_scheduled_service",
132
+ "type": "boolean",
133
+ "description": "true for records typed `airport` (as opposed to heliport, seaplane base, closed)."
134
+ },
135
+ {
136
+ "name": "utc_offset_band",
137
+ "type": "number",
138
+ "description": "UTC offset rounded to the nearest whole hour."
139
+ },
140
+ {
141
+ "name": "n_routes_out",
142
+ "type": "number",
143
+ "description": "Number of scheduled route records departing this airport."
144
+ },
145
+ {
146
+ "name": "n_routes_in",
147
+ "type": "number",
148
+ "description": "Number of scheduled route records arriving at this airport."
149
+ },
150
+ {
151
+ "name": "n_airlines",
152
+ "type": "number",
153
+ "description": "Distinct airlines operating to or from the airport."
154
+ },
155
+ {
156
+ "name": "n_destinations",
157
+ "type": "number",
158
+ "description": "Distinct airports reachable in one non-stop hop."
159
+ },
160
+ {
161
+ "name": "n_destinations_international",
162
+ "type": "number",
163
+ "description": "Distinct destination airports outside the airport's own country."
164
+ },
165
+ {
166
+ "name": "n_countries_served",
167
+ "type": "number",
168
+ "description": "Distinct foreign countries reachable non-stop."
169
+ },
170
+ {
171
+ "name": "n_domestic_routes",
172
+ "type": "number",
173
+ "description": "Route records whose origin and destination are in the same country."
174
+ },
175
+ {
176
+ "name": "share_international_pct",
177
+ "type": "number",
178
+ "description": "Percentage of this airport's route records that cross a border."
179
+ },
180
+ {
181
+ "name": "top_airline",
182
+ "type": "string",
183
+ "description": "Airline with the most route records at this airport."
184
+ },
185
+ {
186
+ "name": "top_airline_routes",
187
+ "type": "number",
188
+ "description": "Route records operated by that airline."
189
+ },
190
+ {
191
+ "name": "mean_route_distance_km",
192
+ "type": "number",
193
+ "description": "Mean great-circle distance of this airport's routes."
194
+ },
195
+ {
196
+ "name": "max_route_distance_km",
197
+ "type": "number",
198
+ "description": "Longest non-stop route from this airport."
199
+ },
200
+ {
201
+ "name": "farthest_destination",
202
+ "type": "string",
203
+ "description": "Airport code of that longest route."
204
+ },
205
+ {
206
+ "name": "hub_class",
207
+ "type": "string",
208
+ "description": "Network role from route count: Isolated, Feeder, Regional, Major, Global hub."
209
+ },
210
+ {
211
+ "name": "capital_distance_km",
212
+ "type": "string",
213
+ "description": "Great-circle distance to the country's capital city."
214
+ },
215
+ {
216
+ "name": "is_near_capital",
217
+ "type": "string",
218
+ "description": "true when the airport is within 40 km of its country's capital."
219
+ },
220
+ {
221
+ "name": "routes_per_million_people",
222
+ "type": "number",
223
+ "description": "Route records divided by country population in millions."
224
+ },
225
+ {
226
+ "name": "country_population",
227
+ "type": "number",
228
+ "description": "Country population (World Bank, joined)."
229
+ },
230
+ {
231
+ "name": "country_gdp_per_capita_usd",
232
+ "type": "number",
233
+ "description": "Country GDP per capita (World Bank, joined)."
234
+ },
235
+ {
236
+ "name": "airports_in_country",
237
+ "type": "number",
238
+ "description": "Number of airports in this file for the same country."
239
+ },
240
+ {
241
+ "name": "name_word_count",
242
+ "type": "number",
243
+ "description": "Number of words in the airport name."
244
+ }
245
+ ]
246
+ }
247
+ },
248
+ {
249
+ "path": "data_dictionary.csv",
250
+ "description": "Full field-level data dictionary detailing column names, data types, and semantic definitions."
251
+ },
252
+ {
253
+ "path": "notebook.ipynb",
254
+ "description": "Starter exploratory data analysis notebook."
255
+ }
256
+ ]
257
+ }
kernel-metadata.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": "samyakrajbayar/world-airport-network-starter-notebook",
3
+ "title": "World Airport Network Starter Notebook",
4
+ "code_file": "notebook.ipynb",
5
+ "language": "python",
6
+ "kernel_type": "notebook",
7
+ "is_private": false,
8
+ "enable_gpu": false,
9
+ "enable_tpu": false,
10
+ "enable_internet": true,
11
+ "dataset_sources": [
12
+ "samyakrajbayar/world-airport-network"
13
+ ]
14
+ }
notebook.ipynb ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "81eccfe7",
6
+ "metadata": {},
7
+ "source": [
8
+ "# World Airport Network\n",
9
+ "\n",
10
+ "Starter notebook for the Kaggle dataset in this folder. It loads `airports.csv` with pandas and walks through quality checks and a first piece of analysis.\n",
11
+ "\n",
12
+ "**Files:** `airports.csv`, `data_dictionary.csv`."
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "markdown",
17
+ "id": "0000f7f2",
18
+ "metadata": {},
19
+ "source": [
20
+ "## 1. Load the data"
21
+ ]
22
+ },
23
+ {
24
+ "cell_type": "code",
25
+ "id": "a3222460",
26
+ "metadata": {},
27
+ "execution_count": null,
28
+ "outputs": [],
29
+ "source": [
30
+ "import pandas as pd\n",
31
+ "\n",
32
+ "df = pd.read_csv(\"airports.csv\", low_memory=False)\n",
33
+ "df[\"routes\"] = df[\"n_routes_out\"].fillna(0) + df[\"n_routes_in\"].fillna(0)\n",
34
+ "print(df.shape)\n",
35
+ "df.head(3)"
36
+ ]
37
+ },
38
+ {
39
+ "cell_type": "markdown",
40
+ "id": "325de123",
41
+ "metadata": {},
42
+ "source": [
43
+ "## 2. Shape, types and missing values"
44
+ ]
45
+ },
46
+ {
47
+ "cell_type": "code",
48
+ "id": "c995eab3",
49
+ "metadata": {},
50
+ "execution_count": null,
51
+ "outputs": [],
52
+ "source": [
53
+ "import pandas as pd\n",
54
+ "\n",
55
+ "print(f\"{df.shape[0]:,} rows x {df.shape[1]} columns\")\n",
56
+ "\n",
57
+ "missing = df.isna().mean().mul(100).sort_values(ascending=False)\n",
58
+ "missing[missing > 0].round(1).to_frame(\"missing_%\").head(15)"
59
+ ]
60
+ },
61
+ {
62
+ "cell_type": "markdown",
63
+ "id": "f2d963fe",
64
+ "metadata": {},
65
+ "source": [
66
+ "## 3. Numeric summary"
67
+ ]
68
+ },
69
+ {
70
+ "cell_type": "code",
71
+ "id": "aa2f8fd4",
72
+ "metadata": {},
73
+ "execution_count": null,
74
+ "outputs": [],
75
+ "source": [
76
+ "df.describe(include='number').T.round(2).head(20)"
77
+ ]
78
+ },
79
+ {
80
+ "cell_type": "markdown",
81
+ "id": "48da4abf",
82
+ "metadata": {},
83
+ "source": [
84
+ "## 4. Busiest airports by route records"
85
+ ]
86
+ },
87
+ {
88
+ "cell_type": "code",
89
+ "id": "9e1066a1",
90
+ "metadata": {},
91
+ "execution_count": null,
92
+ "outputs": [],
93
+ "source": [
94
+ "df.nlargest(15, \"routes\")[[\"name\", \"city\", \"country\", \"iata\", \"routes\",\n",
95
+ " \"n_destinations\", \"n_airlines\"]].set_index(\"iata\")"
96
+ ]
97
+ },
98
+ {
99
+ "cell_type": "markdown",
100
+ "id": "36a65583",
101
+ "metadata": {},
102
+ "source": [
103
+ "## 5. Hub classes\n",
104
+ "\n",
105
+ "How many airports sit in each network role?"
106
+ ]
107
+ },
108
+ {
109
+ "cell_type": "code",
110
+ "id": "d4a31929",
111
+ "metadata": {},
112
+ "execution_count": null,
113
+ "outputs": [],
114
+ "source": [
115
+ "df[\"hub_class\"].value_counts().plot.bar(figsize=(8, 4))"
116
+ ]
117
+ },
118
+ {
119
+ "cell_type": "markdown",
120
+ "id": "36d83338",
121
+ "metadata": {},
122
+ "source": [
123
+ "## 6. Long-haul map\n",
124
+ "\n",
125
+ "Airports with the longest non-stop routes."
126
+ ]
127
+ },
128
+ {
129
+ "cell_type": "code",
130
+ "id": "906036a7",
131
+ "metadata": {},
132
+ "execution_count": null,
133
+ "outputs": [],
134
+ "source": [
135
+ "long = df.dropna(subset=[\"max_route_distance_km\"]).nlargest(20, \"max_route_distance_km\")\n",
136
+ "long[[\"name\", \"city\", \"country\", \"max_route_distance_km\", \"farthest_destination\"]].set_index(\"name\")"
137
+ ]
138
+ },
139
+ {
140
+ "cell_type": "markdown",
141
+ "id": "8a8606ef",
142
+ "metadata": {},
143
+ "source": [
144
+ "## 7. Connectivity vs wealth"
145
+ ]
146
+ },
147
+ {
148
+ "cell_type": "code",
149
+ "id": "5fe95413",
150
+ "metadata": {},
151
+ "execution_count": null,
152
+ "outputs": [],
153
+ "source": [
154
+ "sub = df.dropna(subset=[\"country_gdp_per_capita_usd\", \"routes_per_million_people\"])\n",
155
+ "sub = sub[sub[\"routes\"] > 0]\n",
156
+ "sub.plot.scatter(x=\"country_gdp_per_capita_usd\", y=\"routes_per_million_people\", logx=True, s=10, figsize=(8, 5))"
157
+ ]
158
+ },
159
+ {
160
+ "cell_type": "markdown",
161
+ "id": "552e537e",
162
+ "metadata": {},
163
+ "source": [
164
+ "## 8. Domestic vs international mix for the top 25 airports"
165
+ ]
166
+ },
167
+ {
168
+ "cell_type": "code",
169
+ "id": "5675896b",
170
+ "metadata": {},
171
+ "execution_count": null,
172
+ "outputs": [],
173
+ "source": [
174
+ "top = df.nlargest(25, \"routes\").set_index(\"iata\")\n",
175
+ "(top[[\"n_domestic_routes\", \"n_routes_out\"]]\n",
176
+ " .assign(international=lambda t: t[\"n_routes_out\"] - t[\"n_domestic_routes\"])\n",
177
+ " [[\"n_domestic_routes\", \"international\"]]\n",
178
+ " .plot.barh(stacked=True, figsize=(9, 7)))"
179
+ ]
180
+ },
181
+ {
182
+ "cell_type": "markdown",
183
+ "id": "6e43770c",
184
+ "metadata": {},
185
+ "source": [
186
+ "## Next steps\n",
187
+ "\n",
188
+ "See `KAGGLE.md` for analysis ideas, caveats and provenance."
189
+ ]
190
+ }
191
+ ],
192
+ "metadata": {
193
+ "kernelspec": {
194
+ "display_name": "Python 3",
195
+ "language": "python",
196
+ "name": "python3"
197
+ },
198
+ "language_info": {
199
+ "name": "python",
200
+ "version": "3.11",
201
+ "mimetype": "text/x-python",
202
+ "file_extension": ".py",
203
+ "codemirror_mode": {
204
+ "name": "ipython",
205
+ "version": 3
206
+ },
207
+ "pygments_lexer": "ipython3",
208
+ "nbconvert_exporter": "python"
209
+ }
210
+ },
211
+ "nbformat": 4,
212
+ "nbformat_minor": 5
213
+ }