Data Visualization with Python (10): Choropleth Maps
In the last article, we learned how to create maps for different objectives with the Foluim Library. In this article, we will learn how to create a special type of map called a Choropleth map with Folium.
1. Exploring Datasets with pandas and Matplotlib
1.1 Libraries:
This article heavily relies on pandas and Numpy for data wrangling, analysis, and visualization. The primary plotting library we will explore in this article is Folium.
1.2. Dataset:
We will work with Immigration to Canada from 1980 to 2013 — International migration flows to and from selected countries — The 2015 revision from the Kaggle website. The dataset contains annual data on the flows of international migrants as recorded by the destination governments. The data presents inflows and outflows according to the place of birth, citizenship, or previous/next residence for foreigners and nationals. For this lesson, we will focus on Canadian Immigration data.
2. Downloading and Prepping Data
Import Primary Modules:
import numpy as np
import pandas as pd
import folium