1. Learn
  2. /
  3. Courses
  4. /
  5. Visualizing Geospatial Data in Python

Exercise

Finding counts from a spatial join

You will be using a dataset of the building permits issued in Nashville during 2017. This DataFrame, called permits, has been pre-loaded for you, along with the council_districts GeoDataFrame.

Instructions

100 XP
  • Create a Point geometry column in permits from lat and lng.
  • Create permits_geo, a GeoDataFrame, using permits, the crs from council_districts, and the geometry from permits.
  • Use a spatial join to find permits issued within each council district. Print the first 2 rows.
  • Create permit_counts to show the count of permits within each district, using groupby() and .size(). Print permit_counts.