Finding the neighborhood with the most public art
Now that you have created art_geo, a GeoDataFrame, from the art DataFrame, you can join it spatially to the neighborhoods data to see what art is in each neighborhood.
This exercise is part of the course
Visualizing Geospatial Data in Python
Exercise instructions
- Merge the
art_geoandneighborhoodsGeoDataFrames with a spatial join to create a new GeoDataFrame calledneighborhood_art. Find the art that iswithinneighborhoods. - Print the first few rows of the neighborhood art GeoDataFrame.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# import packages
import geopandas as gpd
import pandas as pd
# Spatially join neighborhoods with art_geo
neighborhood_art = gpd.____(art_geo, neighborhoods, predicate = "____")
# Print the first few rows
print(neighborhood_art.head())