Stacking regional listings
You are a data analyst at an accommodation booking company. Your team received the listings data split across several files by region: coastal properties, inland properties, and island getaways. Before running any analysis, you need to combine these segmented DataFrames into one.
polars is loaded as pl. The DataFrames coastal, inland, and islands are available with matching columns describing each property.
Diese Übung ist Teil des Kurses
<Kurs>Data Transformation with Polars</Kurs>Übungsanweisungen
- Combine
coastal,inland, andislandsinto a single DataFrame calledhotelsby stacking the rows. - Print the first 10 rows to verify the result.
Interaktive praktische Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Combine the regional DataFrames vertically
hotels = pl.____([coastal, inland, islands], how="____")
# Print the first 10 rows
print(hotels.____(____))