Removing whitespace
With the ratings now stored as integers, you notice another issue in the dataset: some values in the detail column have leading whitespace. This inconsistency could cause problems when grouping products by their detail type - " eau de toilette" and "eau de toilette" would be treated as different categories.
Este exercício faz parte do curso
Data Transformation with Polars
Instruções do exercício
- Remove leading whitespace from the
detailcolumn by calling the.strip_chars_start()method.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Remove leading whitespace from the detail column
reviews.____(
pl.col("detail").____.____()
)