Session Ready
Exercise

Spatially joining and getting counts

You will continue preparing your dataset for plotting a geopandas choropleth by creating a GeoDataFrame of the building permits spatially joined to the council districts. After that, you will be able to get counts of the building permits issued in each council district.

Instructions
100 XP
  • Create permits_geo from permits, the council_districts.crs, and the geometry in permits.
  • Spatially join permits_geo and the council_districts to get building permits within each council district. Call this permits_by_district.
  • Count permits in each district, permit_counts, by chaining groupby() and size() methods.
  • Create counts_df from permit_counts. Reset the index, and name the columns district and bldg_permits.