text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import plotly.express as px

import seaborn as sns

df = pd.read_csv('../input/covid19s-impact-on-airport-traffic/covid_impact_on_airport_traffic.csv')

df.isnull().sum()

df1 = df.groupby('Country')['PercentOfBaseline'].mean().sort_values(ascending=False).reset_index()
sns.set(font_scale=1.2)

df1 = df.groupby('City')['PercentOfBaseline'].mean().sort_values(ascending=False).reset_index()
sns.set(font_scale=1.2)

df1 = df.groupby('State')['PercentOfBaseline'].mean().sort_values(ascending=False).reset_index()
sns.set(font_scale=1.2)

df1 = df.groupby('AirportName')['PercentOfBaseline'].mean().sort_values(ascending=False).reset_index()
sns.set(font_scale=1.2)

df['lon'] = df.Centroid.apply(lambda x: x.split(' ')[0].replace('POINT(', ' '))
df['lat'] = df.Centroid.apply(lambda x: x.split(' ')[1].replace(')', ' '))

df1 = df.groupby(['Country', 'City', 'lat', 'lon'])['PercentOfBaseline'].mean().sort_values(ascending=False).reset_index()
fig = px.scatter_geo(df1, lat='lat', lon='lon', hover_name='Country', color='Country', hover_data=['PercentOfBaseline', 'City'], labels={'PercentOfBaseline': 'Percent of Baseline'})
fig.update_geos(showocean=True, oceancolor='LightCyan', lakecolor='LightSteelBlue', showlakes=True)
fig.show()