Mobility: Google COVID-19 Community Mobility Reports

This section describes how to use the Google mobility reports client from Episuite. The main class used to download and parse the Google mobility data is the GoogleMobility.

See also

Google COVID-19 Community Mobility Reports

Google COVID-19 Community Mobility Reports.

Module episuite.mobility.google

Documentation of the episuite.mobility.google module.

[1]:
from matplotlib import pyplot as plt
from episuite.mobility import google

Load Google mobility data

The Episuite API for the Google mobility reports allows you to download the entire dataset or to filter by a single country by using a country/region code. We will here just download data from Brazil using the BR country code.

The mobility reports are increasing in size every day, that’s why filtering by your country code is highly recommended. If you specify the country_region_code while calling the load_report(), Episuite will filter the dataset without loading it entirely to memory.

[3]:
client = google.GoogleMobility()
[5]:
mobility_data = client.load_report(country_region_code="BR",
                                   show_progress=True, cache=True)
[8]:
mobility_data.tail(5)
[8]:
country_region_code country_region sub_region_1 sub_region_2 metro_area iso_3166_2_code census_fips_code place_id date retail_and_recreation_percent_change_from_baseline grocery_and_pharmacy_percent_change_from_baseline parks_percent_change_from_baseline transit_stations_percent_change_from_baseline workplaces_percent_change_from_baseline residential_percent_change_from_baseline
1148236 BR Brazil State of Tocantins Tocantinópolis NaN NaN NaN ChIJdy1nSeuG2pIR7Nmgv2Wq2uo 2021-03-11 NaN NaN NaN NaN -1.0 NaN
1148237 BR Brazil State of Tocantins Tocantinópolis NaN NaN NaN ChIJdy1nSeuG2pIR7Nmgv2Wq2uo 2021-03-12 NaN NaN NaN NaN 13.0 NaN
1148238 BR Brazil State of Tocantins Tocantinópolis NaN NaN NaN ChIJdy1nSeuG2pIR7Nmgv2Wq2uo 2021-03-13 NaN NaN NaN NaN 7.0 NaN
1148239 BR Brazil State of Tocantins Tocantinópolis NaN NaN NaN ChIJdy1nSeuG2pIR7Nmgv2Wq2uo 2021-03-15 NaN NaN NaN NaN 3.0 NaN
1148240 BR Brazil State of Tocantins Tocantinópolis NaN NaN NaN ChIJdy1nSeuG2pIR7Nmgv2Wq2uo 2021-03-16 NaN NaN NaN NaN 5.0 NaN