Aan de slagGa gratis aan de slag

Adding new rows efficiently

A small batch of new listings has arrived in new_listings. Rather than creating a brand new DataFrame with pl.concat(), you can efficiently add these rows directly to the existing hotels DataFrame.

polars is loaded as pl. The DataFrames hotels and new_listings are available for you with matching columns.

Deze oefening maakt deel uit van de cursus

Data Transformation with Polars

Cursus bekijken

Oefeninstructies

  • Add new_listings to hotels in place.
  • Print the last 5 rows to confirm the new listings were added.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Add new_listings to hotels
hotels.____(____)

# Print the last 5 rows
print(hotels.____(____))
Code bewerken en uitvoeren