Historical UK air pollution data can be requested as .csv files from the DEFRA website.

JSON format hourly data since from Sept 2017 is available through the air-aware API.


Interactive air quality charts

Consuming REST APIs in Flask applications which use JavaScript Plotting Libraries


Data Manipulation

Replace missing values using linear interpolation

Replace missing values using mean concentrations for a certain time interval

Reorganising data in a pandas Dataframe with NumPy arrays

Reshaping a pandas DataFrame from wide to long format

Obtaining statistical data for certain time intervals from time series data


Data Visualisation

Creating conditional plots using FacetGrid in Seaborn

Plotting categorical data using Seaborn’s box plot function

Plotting time series data using the Bokeh visualisation library


Python libraries

Third-party libraries: The following examples depend upon a small number of third-party libraries including pandas, matplotlib and requests

Jupyter Notebook: The Jupyter Notebook provides a convenient means for running short scripts to manipulate data and render charts

Flask: A Python web development framework well suited for making API calls and plotting live data with interactive charts