#7: Choropleth Maps


MicroProject collectable card

MicroProject Overview

Geographical data visualizations are some of the most impactful forms of data visualization, as these visualizations easily allows the user to locate places familiar to themselves. One popular geographical visualization is a choropleth map -- a map that shades a geographical region to visually encode data about the region. As an example, population density maps and per-capita income maps are common choropleth maps.

Understanding how to use an external library, and read the documentation provided by a library developer, is a critical skill to always continuing to learn and expand your Data Science skills! In this MicroProject, you will learn about the folium Python library -- https://python-visualization.github.io/folium/ -- to create choropleth maps from a DataFrame!

Let's nerd out! :)

Additional Python Libraries Needed

In order to complete this MicroProject, you will need an additional library (folium) that is used to create choropleth maps (in addition to the standard data science libraries). To install it, run the following command in your terminal:

python3 -m pip install folium

Video Walkthrough

MicroProjects with Michelle #07: Choropleth Maps

MicroProject Preview

MicroProject in Visual Studio Code
MicroProject in Visual Studio Code
University of Illinois Demographics by State, from the Division of Management Information
University of Illinois Demographics by State, from the Division of Management Information
Choropleth Map of the Home Addresses of Students Attending the University of Illinois
Choropleth Map of the Home Addresses of Students Attending the University of Illinois
Folium 0.14.0 documentation's Quickstart Guide on Choropleth Maps
Folium 0.14.0 documentation's Quickstart Guide on Choropleth Maps

First Time Doing a MicroProject?

Each MicroProject starts with a notebook that we provide to you to get started! You will need to configure a git repository to connect to our `microprojects` remote where we release the starter notebook.


Fetch the Initial Files

In your terminal, navigate to your GitHub repository and merge the initial files by running the following commands:

git fetch microprojects
git merge microprojects/microproject-07-choropleth-maps --allow-unrelated-histories -m "Merging initial files"

Complete the Notebook

If the commands above were successful, you have merged in the initial files to start on the MicroProject.

  • Find the new microproject-07-choropleth-maps folder.
  • Open microproject-07-choropleth-maps.ipynb and complete the MicroProject!

Commit and Grade Your Notebook

Once you have finished your notebook, you must use the built-in GitHub Action to preform automated grading of your MicroProject notebook! You will need to commit your work and then manually run the GitHub Action.

Commit Your Work

To commit your notebook, run the standard git commands in your terminal:

git add -u
git commit -m "microproject completed"
git push

Grade Your Notebook

To grade your notebook, you will need to visit your GitHub repository in your browser.

  • Visit your GitHub repository in your browser
  • Click on the "Actions" tab
  • Under "Workflows", find the workflow for this microproject
  • Click the "Run Workflow" in the blue box, and then the green "Run Workflow"
  • After about 10 seconds, you should see a new job that has started running
    • You can click on the job to watch it run in real-time
    • It will take ~1 minute to run and grade
  • Once the running is complete, the autograding summary will be available!