Concatenating text columns
With the whitespace cleaned up, you realize that some products have the same detail but come in different sizes. To uniquely identify each product variant, you need to combine the detail and size columns into a single identifier.
Questo esercizio fa parte del corso
Data Transformation with Polars
Istruzioni dell'esercizio
- Concatenate the
detailandsizecolumns with a colon separator and name the new columndetail_size.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Combine detail and size into a new column
reviews.with_columns(
pl.____(["detail", "size"], separator="____").____("detail_size")
)