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

Adding flag columns

Another team prepared flag columns for each listing: a price band category and a review attention flag. These are stored in a separate DataFrame called tags, aligned with hotels. You need to add these columns to hotels to display them side by side.

polars is loaded as pl. The DataFrames hotels and tags are preloaded for you.

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

Data Transformation with Polars

Kursa Göz Atın

Egzersiz talimatları

  • Combine hotels and tags side by side into a new DataFrame called hotels_with_flags.
  • Print a few rows to verify the new columns were added.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Combine hotels and tags horizontally
hotels_with_flags = pl.concat([____, ____], how="____")

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