MulaiMulai sekarang secara gratis

Paris: spatial join of districts and bike stations

Let's return to the Paris data on districts and bike stations. We will now use the spatial join operation to identify the district in which each station is located.

The districts and bike sharing stations datasets are already pre-loaded for you as the districts and stations GeoDataFrames, and GeoPandas has been imported as geopandas

Latihan ini adalah bagian dari kursus

Working with Geospatial Data in Python

Lihat Kursus

Petunjuk latihan

  • Use the geopandas.sjoin() function to add the district name in which each station is located to the stations dataset. Call the result joined.
  • Check the result by showing the first five rows.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Join the districts and stations datasets
joined = ____

# Inspect the first five rows of the result
print(joined.____)
Edit dan Jalankan Kode