ComeçarComece de graça

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.

Este exercício faz parte do curso

Data Transformation with Polars

Ver curso

Instruções do exercício

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

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Combine detail and size into a new column
reviews.with_columns(
    pl.____(["detail", "size"], separator="____").____("detail_size")
)
Editar e executar o código