Do-It-Yourself#

Let’s make a bunch of choropleths! In this section, you will practice the concepts and code we have learnt in this block. Happy hacking!

Data preparation#

Note

The AHAH dataset was invented by a University of Liverpool team. If you want to find out more about the background and details of the project, have a look at the information page at the CDRC website.

We are going to use the Access to Healthy Assets and Hazards (AHAH) index. This is a score that ranks LSOAs (the same polygons we used in block C) by the proximity to features of the environment that are considered positive for health (assets) and negative (hazards). The resulting number gives us a sense of how “unhealthy” the environment of the LSOA is. The higher the score, the less healthy the area is assessed to be.

To download the Liverpool AHAH pack, please go over to:

Important

You will need a username and password to download the data. Create it for free at:

Once you have the .zip file on your computer, right-click and “Extract all”. The resulting folder will contain all you need. For the sake of the example, let’s assume you place the resulting folder in the same location as the notebook you are using. If that is the case, you can load up a GeoDataFrame of Liverpool neighborhoods with:

import geopandas
lsoas = geopandas.read_file("Access_to_Healthy_Assets_and_Hazards_AHAH_E08000012/data/Access_to_Healthy_Assets_and_Hazards_AHAH/Local_Authority_Districts/E08000012/shapefiles/E08000012.shp")

Now, this gets us the geometries of the LSOAs, but not the AHAH data. For that, we need to read in the data and join it to ahah. Assuming the same location of the data as above, we can do as follows:

import pandas
ahah_data = pandas.read_csv("Access_to_Healthy_Assets_and_Hazards_AHAH_E08000012/data/Access_to_Healthy_Assets_and_Hazards_AHAH/Local_Authority_Districts/E0800001/tables/E08000012.csv")

To read the data, and as follows to join it:

ahah = lsoas.join(ahah_data.set_index("lsoa11cd"), on="lsoa11cd")

Now we’re ready to map using the ahah object.

Tasks#

Task I: AHAH choropleths#

Create the following choropleths and, where possible, complement them with a figure that displays the distribution of values using a KDE:

  • Equal Interval with five classes

  • Quantiles with five classes

  • Fisher-Jenks with five classes

  • Unique Values with the following setup:

    • Split the LSOAs in two classes: above and below the average AHAH score

    • Assign a qualitative label (above or below) to each LSOA

    • Create a unique value map for the labels you have just created

Task II: Zoom maps#

Generate the following maps: