daft.Expression.str.concat

daft.Expression.str.concat#

Expression.str.concat(other: str | daft.expressions.expressions.Expression) Expression[source]#

Concatenates two string expressions together

Note

Another (easier!) way to invoke this functionality is using the Python + operator which is aliased to using str.concat. These are equivalent:

Example

>>> import daft
>>> df = daft.from_pydict({"x": ["foo", "bar", "baz"], "y": ["a", "b", "c"]})
>>> df.select(col("x").str.concat(col("y"))).collect()
╭──────╮
│ x    │
│ ---  │
│ Utf8 │
╞══════╡
│ fooa │
├╌╌╌╌╌╌┤
│ barb │
├╌╌╌╌╌╌┤
│ bazc │
╰──────╯

(Showing first 3 of 3 rows)
Parameters:

other (Expression) – a string expression to concatenate with

Returns:

a String expression which is self concatenated with other

Return type:

Expression