How to Make Maps with Python (Part 1: Plot the World with GeoPandas)

Proto Bioengineering
7 min readMay 15, 2024

Plot the world with 7 lines of code.

Online resources for making maps in Python are a hodge-podge of incomplete tutorials and odd StackOverflow answers. They don’t answer in simple terms: “How do you just make a map?”

This series of articles will cover how to create maps in Python, from simple to complex. In this article, we will make the simplest map possible of the world to show you just how easy it is.

All of the code in this tutorial is available in a Kaggle notebook.

Requirements

  • Python 3
  • (optional) a Kaggle account

Steps

  1. Install Pandas, GeoPandas, Geodatasets, and Matplotlib
  2. Create a Python file (or Kaggle notebook)
  3. Import Pandas, GeoPandas, Geodatasets, and Matplotlib
  4. Load map data for the world from Geodatasets
  5. Plot the map data
  6. Bonus: Plot country boundaries

Step 1: Install Pandas, GeoPandas, Geodatasets, and Matplotlib

The libraries Pandas, GeoPandas, Geodatasets, and Matplotlib are some of the most popular…

--

--

Proto Bioengineering

Learn to code for science. “Everything simple is false. Everything complex is unusable.” — Paul Valery