Concatenating and combining strings
Concatenating or combining strings is another way to derive meaningful information from your text data. The ability to concatenate and combine strings is a fundamental skill in the data domain. It facilitates data preparation, feature engineering, and the integration of disparate datasets, contributing to the overall success of any data project.
In this recipe, we’ll cover a few ways to concatenate strings in Python Polars.
Getting ready
In this recipe, we’ll use a DataFrame that has been created manually:
df = pl.DataFrame( { 'colA': ['a', 'b', 'c', 'd'], 'colB': ['aa', 'bb', 'cc', 'dd'] } )
How to do it...
Here are a few methods you can use:
- Use
+
to concatenate strings...