In this lesson, you’ll learn what Folium is and how to install it. For more information on getting set up, check out:
Getting Started With Folium
00:53 You can create maps based on cities, regions, or countries with Folium. You can add boundaries to your map by including information from GeoJSON files—for example, the boroughs of New York City.
01:08 You can include markers for points of interest along with pop-ups or tooltips, so that text appears when users click on or mouse over those markers. And finally, Folium also allows you to create choropleths, where each color of each region represents underlying data values. Remember that Folium is a Python library, so oftentimes that data will come from a pandas DataFrame.
To follow along with the code demonstrated in this course, be sure to check out the Jupyter Notebook and the resources below. You can run that code by either installing the Anaconda distribution, if you don’t have it already, or you can create a virtual environment with the specific libraries that you’ll need. Check out the Real Python lesson called Creating a Virtual Environment if you need additional help getting set up. We’ll be using the pandas library, which is included in Anaconda, as well as the GeoJSON library, which you can get through
conda. Of course, you’ll also be working with the Folium library.
To install Folium on your machine, run the command
pip install folium from your command line. Then when it’s time to use the Folium library, just execute
import folium from your Jupyter Notebook or Python script.
02:34 That covers the basics of Folium, a Python library for creating interactive Leaflet.js maps. Coming up next, we’ll be coding in a Jupyter Notebook, and you’ll find out just how simple mapmaking can be.
Become a Member to join the conversation.