เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

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.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Visualizing Geospatial Data in Python

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Merge the art_geo and neighborhoods GeoDataFrames with a spatial join to create a new GeoDataFrame called neighborhood_art. Find the art that is within neighborhoods.
  • Print the first few rows of the neighborhood art GeoDataFrame.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# 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())
แก้ไขและรันโค้ด