Return to table of contents

Air pollution in Beijing

Color a year of air pollution in Beijing and see how it affects the health of the local population

Air pollution in Beijing

Data sources

U.S Embassy Beijing Air Quality Monitor’s Historical Data 2015, U.S. Department of State.

The data includes:

How the data was used

Code

A python script is available in the code repository to generate or extend this activity, and can be run like this:

python air_pollution.py

Which will create an svg file with one circle per day in the year with the AQI category represented as a label from 1 to 7. You can try different years by downloading the .csv files in the historical data set, and running the script with the input parameter:

python air_pollution.py -input data/Beijing_2015_HourlyPM25_created20160201.csv

You can also show the mean PM 2.5 measurement for the day instead of the peak measurement:

python air_pollution.py -reduce mean