text_html_output_1.png
import pandas as pd

import pandas as pd
apple_mobility_df = pd.read_csv('../input/apple-mobility-trends-updated-daily/Apple_Mobility_2020-04-13.csv')
apple_mobility_df.drop('Unnamed: 0', axis=1, inplace=True)

geo_mask = apple_mobility_df['geo_type'] == 'country/region'
mobility_countries = apple_mobility_df[geo_mask]
mobility_cities = apple_mobility_df[~geo_mask]

mobility_countries_melted = mobility_countries.melt(id_vars=['geo_type', 'region', 'transportation_type', 'lat', 'lng', 'population'], var_name='Date', value_name='pct_of_baseline')
mobility_cities_melted = mobility_cities.melt(id_vars=['geo_type', 'region', 'transportation_type', 'lat', 'lng', 'population'], var_name='Date', value_name='pct_of_baseline')
mobility_cities_melted.head()