Show code
import numpy as np
import pandas as pd
import polars as pl
import duckdb as db
import plotly.express as px
import folium
from folium.plugins import FullscreenJesus LM
Oct, 2024
As a popular tourist destination, Mexico offers visitors a diverse range of experiences, from ancient ruins to pristine beaches. The country’s well-connected airport system ensures seamless travel to these captivating destinations.
As the busiest airport in Mexico, Mexico City International Airport serves as a major hub for both domestic and international flights. Located on the outskirts of the city, it offers connections to numerous destinations worldwide.
Situated on the Caribbean coast, Cancún International Airport is a popular gateway for travelers seeking sun, sand, and turquoise waters. It serves as the main airport for the popular resort town of Cancún and the surrounding Riviera Maya region.
Located in the second-largest city in Mexico, Guadalajara International Airport is a significant transportation hub, connecting the city to major domestic and international destinations. It is also a gateway to the Tequila region, famous for its production of the iconic Mexican spirit.
Mexico also has a network of regional airports that serve smaller cities and popular tourist destinations. Some of the notable ones include:
Located on the Pacific coast, Puerto Vallarta International Airport is a popular gateway for travelers seeking a more relaxed atmosphere. It serves the coastal resort town of Puerto Vallarta and the surrounding area.
Situated on the southern tip of the Baja California peninsula, Los Cabos International Airport is a popular destination for luxury travelers. It serves the resort towns of Cabo San Lucas and San José del Cabo.
Located in the industrial city of Monterrey, Monterrey International Airport is a significant transportation hub for northern Mexico. It serves as a gateway to the city and the surrounding region.
Mexican airports generally offer a range of facilities and services to ensure a comfortable and convenient travel experience. These may include:
shape: (7_698, 3)
┌─────────────────────────────────┬──────────────────┬─────────────────────┐
│ Name ┆ Country ┆ City │
│ --- ┆ --- ┆ --- │
│ str ┆ str ┆ str │
╞═════════════════════════════════╪══════════════════╪═════════════════════╡
│ Goroka Airport ┆ Papua New Guinea ┆ Goroka │
│ Madang Airport ┆ Papua New Guinea ┆ Madang │
│ Mount Hagen Kagamuga Airport ┆ Papua New Guinea ┆ Mount Hagen │
│ Nadzab Airport ┆ Papua New Guinea ┆ Nadzab │
│ Port Moresby Jacksons Internat… ┆ Papua New Guinea ┆ Port Moresby │
│ Wewak International Airport ┆ Papua New Guinea ┆ Wewak │
│ Narsarsuaq Airport ┆ Greenland ┆ Narssarssuaq │
│ Godthaab / Nuuk Airport ┆ Greenland ┆ Godthaab │
│ Kangerlussuaq Airport ┆ Greenland ┆ Sondrestrom │
│ Thule Air Base ┆ Greenland ┆ Thule │
│ Akureyri Airport ┆ Iceland ┆ Akureyri │
│ Egilsstaðir Airport ┆ Iceland ┆ Egilsstadir │
│ Hornafjörður Airport ┆ Iceland ┆ Hofn │
│ Húsavík Airport ┆ Iceland ┆ Husavik │
│ Ísafjörður Airport ┆ Iceland ┆ Isafjordur │
│ … ┆ … ┆ … │
│ Kalocsa/Foktő Airport ┆ Hungary ┆ Kalocsa/Foktő │
│ Bilogai-Sugapa Airport ┆ Indonesia ┆ Sugapa-Papua Island │
│ Jakkur Aerodrome ┆ India ┆ Bengaluru │
│ Jalal-Abad Airport ┆ Kyrgyzstan ┆ Jalal-Abad │
│ Ramon Airport ┆ Israel ┆ Eilat │
│ Rustaq Airport ┆ Oman ┆ Al Masna'ah │
│ Laguindingan Airport ┆ Philippines ┆ Cagayan de Oro City │
│ Kostomuksha Airport ┆ Russia ┆ Kostomuksha │
│ Privolzhskiy Air Base ┆ Russia ┆ Astrakhan │
│ Kubinka Air Base ┆ Russia ┆ Kubinka │
│ Rogachyovo Air Base ┆ Russia ┆ Belaya │
│ Ulan-Ude East Airport ┆ Russia ┆ Ulan Ude │
│ Krechevitsy Air Base ┆ Russia ┆ Novgorod │
│ Desierto de Atacama Airport ┆ Chile ┆ Copiapo │
│ Melitopol Air Base ┆ Ukraine ┆ Melitopol │
└─────────────────────────────────┴──────────────────┴─────────────────────┘
fig = px.bar(top20, x='Country', y='Airports')
fig.update_traces(marker_color='#7f0000')
fig.update_layout(
template='ggplot2',
width=850,
height=500,
title='Top 20 Countries with Most Airports',
xaxis_tickfont_size=12,
yaxis=dict(
title='Airports',
titlefont_size=16,
tickfont_size=14,
))
fig.show()You can hover over the bars on the chart to get further information.
1 Mexico is the 15th country with most airports (counting 84 airports)
# Mexico airports map
m = folium.Map(
location=[25, -105],
zoom_start=5,
control_scale=False,
)
# Layers
Airports = folium.FeatureGroup(name='<u><b>Airport</b></u>', show=True)
m.add_child(Airports)
#draw marker with symbol you want at base
my_symbol_css_class= """ <style>
.fa-mysymbol3:before {
font-family: Gill Sans;
font-weight: bold;
font-size: 11px;
color: white;
background-color:'';
border-radius: 10px;
white-space: pre;
content: 'P';
}
</style>
"""
# the below is just add above CSS class to folium root map
m.get_root().html.add_child(folium.Element(my_symbol_css_class))
# then we just create marker and specific your css class in icon like below
for i in airports.index:
html=f"""
<p style="font-size: 14px;">Airport: {airports.iloc[i]['Name']}</font></p>
<p style="font-size: 14px;">City: {airports.iloc[i]['City']}</font></p>
"""
iframe = folium.IFrame(html=html, width=280, height=90)
popup = folium.Popup(iframe, max_width=250)
folium.Marker(
location = [airports.iloc[i]['Latitude'], airports.iloc[i]['Longitude']],
icon = folium.Icon(color='darkred', prefix='fa', icon='fa-mysymbol3'),
popup = popup,
tooltip = airports.iloc[i]['Name']
).add_to(Airports)
folium.plugins.Fullscreen().add_to(m)
mYou can hover over the icons on the map to get further information and zoom in or out.
Jesus LM
Economist & Data Scientist