• Posts
  • Spatial Lab
  • Modern GIS Accelerator
  • The Spatial SQL Book

Get the newsletter

Join 71,000+ geospatial experts growing their skills and careers. Get updates on the most cutting edge updates in modern GIS and geospatial every week.

Edit Content
  • LinkedIn
  • YouTube
Uncategorized

Get started with Python and GeoPandas in 3 minutes

December 7, 2021 Matt Forrest Comments Off on Get started with Python and GeoPandas in 3 minutes

Looking to get started with geospatial Python and GeoPandas! Below you can find the step-by-step instructions to go along with the following video to get you up and running with GeoPandas in no time at all.

First, open Google Colab

Google Colab

First, head over to Google Colab and get started by creating a new notebook. Google Colab is a free service from Google that provides a hosted notebook interface for Python that has some libraries pre-installed. It is one of the fastest ways to get started with Python in a notebook interface!

Install and Import GeoPandas

In the first cell of the notebook, you can install GeoPandas using pip. Normally, you would use pip on the machine or server where you have Python installed, but in the notebook, you can install it in a normal cell using this command:

pip install geopandas

Next, you can import the library and give it a shorthand name in the next cell:

import geopandas as gpd

Read a file and plot the map

Next, you can download some data (the data I used in the video can be found here) and read the file using the read_file() command. You can then plot a very simple map using the plot() function. This is a super simple map with no frills, but after this, you have just installed and started using GeoPandas!

Read and plot data

Filter the data and make a map

If you are following along in the video, I show a few different techniques for filtering your data by filtering rows as well as using the isin() function from Pandas. You can check out the Pandas Cheat Sheet and the Pandas Cookbook for more details, in addition to the Pandas docs.

I also created a small buffer around the state of Rhode Island which you can find more information on in the GeoPandas docs.

Try it yourself!

Next, test out some of the guides from the GeoPandas User Guide, Getting Started, and Examples Gallery! You can also check out some other geospatial Python resources in my guide below.

75+ Geospatial Python and Spatial Data Science Resources and Guides
  • Python
Matt Forrest

Post navigation

Previous
Next

Search

Categories

  • Article (23)
  • Tutorial (5)

Recent posts

  • How to Run Scalable Geospatial Analysis with Apache Sedona – Right From Your Laptop
  • Geospatial Tools Compared: When to Use GeoPandas, PostGIS, DuckDB, Apache Sedona, and Wherobots
  • Scaling GIS Workflows with COGs, Airflow, and Apache Iceberg

Tags

aggregations Apache Airflow Apache Iceberg Apache Sedona bigquery Cloud GIS Cloud Optimized GeoTIFF duckdb geoparquet geospatial gis Modern GIS postgis Python snowflake Spatial SQL sql zip codes

Related posts

Article

The 37 Geospatial Python Packages You Definitely Need

January 3, 2024 Matt Forrest Comments Off on The 37 Geospatial Python Packages You Definitely Need

When performing geospatial analysis, the right set of tools can be the difference between surface-level insights and deep, actionable intelligence. Fortunately, amazing geospatial Python packages help to bridge this gap. Python, renowned for its versatility and robustness, offers a wide range of packages that can not only help you scale your spatial analysis, but reach […]

Learn geospatial Python
Uncategorized

Learn Geospatial Python with these top courses

October 26, 2022 Matt Forrest Comments Off on Learn Geospatial Python with these top courses

Python is fast becoming one of the top languages for data analysis and data science, and for good reason. It is quick to learn, can be used for many use cases, and is fast becoming a key skill for job seekers. Python for GIS and geospatial analysis is no different. It can help you scale […]

Article

Top Modern GIS Skills for Spatial Data Science in 2022

April 26, 2022 Matt Forrest Comments Off on Top Modern GIS Skills for Spatial Data Science in 2022

Spatial data science has been one of the fastest-growing career paths in modern GIS in the past few years. The combination of the boom in the data science path, proliferation and popularity of Python, and demand for more flexible/technical roles in data science and analytics have spilled over into modern GIS. Yet spatial data science […]

Spatial Lab
  • Join the Spatial Lab community
Courses
  • Learn Modern GIS with courses and certifications
Spatial SQL
  • Get the Spatial SQL book today
Join Us

© Matt Forrest 2024. All Rights Reserved.