BaşlayınÜcretsiz başlayın

Adding host information

You want to enrich your listings with host details. A hosts DataFrame contains host names and cities, linked by a shared host_id column. Join these DataFrames to see which host manages each property.

polars is loaded as pl, and the DataFrames hotels and hosts are available for you.

Bu egzersiz, kursun bir parçasıdır

Data Transformation with Polars

Kursa Göz Atın

Egzersiz talimatları

  • Join hotels with hosts on host_id to keep only matching rows.
  • Print a few rows to check the join worked.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Join hotels with hosts on host_id
enriched = hotels.____(hosts, on="____", how="____")

# Print a few rows
print(enriched.____())
Kodu Düzenle ve Çalıştır