Get startedGet started for free

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.

This exercise is part of the course

Data Transformation with Polars

View Course

Exercise instructions

  • Concatenate the detail and size columns with a colon separator and name the new column detail_size.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Combine detail and size into a new column
reviews.with_columns(
    pl.____(["detail", "size"], separator="____").____("detail_size")
)
Edit and Run Code