Member-only story
How to Generate Interactive Maps with Folium
Using this Python library to create map visualizations
Data visualization is one of the most overlooked areas of data science. Machine learning and statistical analysis are important, but being able to visualize data, especially different types of data, is a key aspect of data storytelling. While many introductory data science bootcamps and courses will cover how to create basic plots with matplotlib and seaborn, several of them do not cover how to visualize geographic data on maps.
Folium is a Python library that uses Leaflet.js and Open Street Map data to create high-quality map visualizations. In this article, I will demonstrate how you can use Folium to generate interactive map visualizations.
Installation
We can easily install Folium using pip as demonstrated below.
pip install folium
Import Libraries
As usual, I will import some Folium and some other libraries that we may need before getting started. Keep in mind you can find all of the code for this tutorial on GitHub.
import numpy as np
import pandas as pd
import folium