How did Lockdown impact our daily movement?

A look at community mobility in India during a nation-wide lockdown using Google’s Community Mobility data

Anirudh Chandra
Towards Data Science
8 min readJul 25, 2020

--

Preface

The COVID-19 pandemic threw a wrench into the daily lives of people all over the world. In an attempt to combat this public health menace, countries imposed blanket nation-wide lockdown measures that brought life to a screeching halt. What was once a continuous, flowing entity of diverse souls, had now become a static mass of nerves and uncertainty. With time, as these measures were eased in a few countries, people stepped out with a little more confidence and even considered visiting their favourite coffee house!

“A rolling stone gathers no moss”

This proverb got me thinking if there was some way to observe this movement, or lack of thereof, of communities in these trying times.

A chance reading of an article two weeks ago brought me to Google’s Community Mobility reports. Here was a product that helped users understand the changes in visitors to different kinds of locations.

Google has freely provided this data for a large number of countries, with the aim of providing public health officials useful insights on tackling the pandemic. To know more about how Google collects, aggregates and anonymises this data, please visit their help page.

Motivation

In this post, I explore this dataset to derive some personal insights on how the recent lockdown measures, implemented in my country — India, affected the regular, routine movement of communities in Maharashtra and Delhi, two States with more than 100,000 confirmed positive cases.

Project Workflow

Like always, I used a simple workflow to structure my enquiries. The entire code and dataset can be found on my GitHub repository.

1. Data Gathering

The community mobility dataset was downloaded from here as a .csv file and read into a data-frame. I also used the daily COVID-19 case count of different States in India from this crowdsourced database. The detailed documentation for the API can be found here.

2. Data Preprocessing

The two datasets were already cleaned for spuriously high/low values/wrong data format/missing values before being uploaded.

From the global community mobility dataset, I extracted the data for Maharashtra and Delhi and kept those features that were of interest — ‘retail and recreation’, ‘grocery and pharmacy’, ‘parks’,’transit stations’,’workplaces’ and ‘residences’. I also created an additional feature to label the daily data as ‘pre’ and ‘during lockdown’.

From the COVID-19 dataset, I extracted data for Maharashtra and Delhi and retained only the daily number of confirmed positive cases.

(Note: These lockdown measures were ordered nation-wide, with each State having the prerogative to continue their own lockdown measures, depending on their case counts.)

3. Exploratory Data Analysis

i. Basic information

In India, Phase 1 of the nation-wide lockdown was ordered on 22-March and a quick look at the mobility data showed that there were 154 days of mobility data for each State under consideration, from 15-February up to 17-July.

The COVID-19 data had case counts beginning from 14-March. Although the first case in India was detected as far back as January, the crowdsourced data begins only from 14-March. There were 133 days of case count data up to 24-July in the Maharashtra and Delhi datasets respectively.

ii. Aggregate statistics

A measure of mean (average) and spread (interquartile range) would give some aggregate information on the influence of successive lockdown measures on mobility changes of communities in Maharashtra and Delhi.

The violin plot gives a sense of spread in data, or in other words, the variation in the mobility change. A larger spread in the violin-plot implies a greater variation, which may be interpreted as a large influence of lockdown measures on mobility.

It is immediately obvious that there is a dramatic difference in mobility of people, before and during lockdown.

One can see that parks, retails and recreation locations showed the least spread, which could be interpreted that over the course of multiple lockdowns, not many people had visited these localities, as they were still in the low 60–80% decline.

Greater spread in mobility were visible in workplaces, groceries and pharmacies. This may be interpreted as a larger influence of successive lockdowns on people visiting these places. The nature of this influence is shown in the next section.

Looking at the average change across each location category, both the States showed similar average decline in visitors to retail and recreation, transit stations, workplaces and residences.

In Delhi, parks suffered the largest drop in the number of visitors (98% decline) while in Maharashtra, retail and recreation outlets saw the largest decline in visitors (89% decline) during the lockdown.

Since lockdown required us to stay at home for prolonged periods of time, the increase in the number of people at residences was nearly 10 times the change during pre-lockdown months (Jan to Feb).

During the lockdown, only essential services such as groceries and pharmacies were allowed to be visited, and hence their average decline in visitors is much lower than the other location categories, in both the States.

These aggregate statistics gave some useful insights to answer a few queries surrounding the effectiveness of lockdown measures.

4. Trend Analysis

i. What was the general influence of multiple lockdowns on the movement of people?

In India, lockdown was ordered in 4 phases from 22-March till 31-May, after which an ‘un-lockdown’ was ordered in 2 phases from 1-June till date. Each phase of the lockdown was accompanied by a slew of measures to prevent congregation of people, restrict non-essential movement and maintain social distancing. I plotted the weekly averaged percentage change in number of visitors/people to observe the trend.

In Maharashtra and Delhi, as community restrictions were eased off with successive lockdowns, there was a gradual increase in people going out of their homes to different locations, which was also confirmed by a decreasing trend in the percentage of people staying at their residences for extended periods of time.

ii. How did lockdown impact the footfalls at retail outlet and recreation facilities?

Retail and recreation outlets saw a steady increase in visitors with successive lockdowns. After the Un-lockdown 1 was announced by the Central Government, the mobility of people to retail and recreation locations increased in Delhi, more than in Maharashtra. The rise and apparent drop in confirmed COVID-19 cases in Delhi, while the continued rise in cases in Maharashtra in the month of June, might also have influenced this disparity in trend.

ii. Did people visit groceries and pharmacies more frequently in Maharashtra than in Delhi?

When compared to other locations, groceries and pharmacies saw the largest increase in mobility during multiple lockdowns as they were considered essential services. There was no discernible difference in trend between the two States, but the percentage increase in Maharashtra seemed to be higher than in Delhi.

iii. Did people visit parks more often than pre-lockdown days

There was an obvious decline in people visiting parks due to movement restrictions. This decline was steeper in Delhi than in Maharashtra, especially after the second week of April. In this week there was an increase in the daily cases which prompted the Delhi Government to impose stricter measures to ban movement of people. However, with time and easing restrictions, there was an increase in visitors to parks in Delhi, while in Maharashtra there hasn’t been any significant change.

iv. Did train stations see more or less foot traffic during lockdown?

After the first lockdown was declared on 22-March, there was a minor surge in visitors to transit stations, perhaps in an attempt to return to hometowns and cities. This was visible in the day-wise plot, not the weekly averaged time series. Thereafter, with time and reduced restrictions, there was a gradual increase in visitors to transit stations. After 1-May, special trains, called ‘Shramik Trains’ were started to ferry migrant workers across the country. This could have also been a reason for the increase in mobility in May. There seemed to be no significant difference in trends in the two States.

v. Were people called to work despite restriction on travel and closing of establishments?

Throughout the first two lockdowns (~45 days) people were actively encouraged to work from home. Private and Government establishments tried to accommodate this new culture and was reflected as a deep decline in visitors to workplaces. However, after Lockdown 3, when travel restrictions were lifted partially, the number of people visiting workplaces increased in both the States. People were now called to work in a graded manner to reduce congregation at office spaces.

vi. Did we stay inside our homes the whole time?

Compared to pre-lockdown days, we stayed inside our homes for longer periods of time. Up till Lockdown 3 there weren’t too many people stepping outside their homes. After Lockdown 3, there was a gradual decrease in people staying at home for prolonged periods. However, in Maharashtra, due to continued partial lockdown, people continued staying indoors even in July, as compared to Delhi.

Conclusion

From analysing this community mobility data, I could confirm a few suspicions I had had before.

  • Overall, the easing of restrictions in successive lockdowns has had a positive influence on the mobility of people to typical locations of interest.
  • Parks, retail and recreation localities saw the greatest decline in visitors, while groceries and pharmacies saw the highest rise in visitors.
  • We were compelled to stay indoors for extended periods of time, much longer than before, and this was reflected in the data.
  • After the third phase of Lockdown, the mobility to different locations increased.
  • The rising cases in Maharashtra and continued partial lockdown has reduced the mobility of people below that of Delhi, which has seen a recent fall in cases and fast rise in mobility of communities.

The number of confirmed cases certainly influences the imposition or removal of a lockdown and the tradeoff between economic benefits of unrestricted movement and public health impact of fewer infections is a difficult task to manage.

Disclaimer: The views and observations presented here are purely personal.

That’s it folks! I hope you enjoyed this post. This was a fun project to make some sense of what is happening around me and I’ll be posting more interesting content soon.

Ciao!

--

--