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.
本练习是课程的一部分
Data Transformation with Polars
练习说明
- Add
new_listingstohotelsin place. - Print the last 5 rows to confirm the new listings were added.
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Add new_listings to hotels
hotels.____(____)
# Print the last 5 rows
print(hotels.____(____))