공공 예술 작품이 가장 많은 동네 찾기
이제 art DataFrame에서 만든 GeoDataFrame art_geo가 있으니, 이를 neighborhoods 데이터와 공간 조인하여 각 동네에 어떤 예술 작품이 있는지 확인해 보세요.
이 연습은 강의의 일부입니다
Python으로 지리공간 데이터 시각화하기
연습 안내
- 공간 조인을 사용해
art_geo와neighborhoodsGeoDataFrame을 병합하여neighborhood_art라는 새 GeoDataFrame을 만드세요. 작품이 동네within에 있는 항목을 찾으세요. - 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())