daft.Expression.str.reverse

daft.Expression.str.reverse#

Expression.str.reverse() Expression[source]#

Reverse a UTF-8 string

Example

>>> import daft
>>> df = daft.from_pydict({"x": ["foo", "bar", "baz"]})
>>> df = df.select(df["x"].str.reverse())
>>> df.show()
╭──────╮
│ x    │
│ ---  │
│ Utf8 │
╞══════╡
│ oof  │
├╌╌╌╌╌╌┤
│ rab  │
├╌╌╌╌╌╌┤
│ zab  │
╰──────╯

(Showing first 3 of 3 rows)
Returns:

a String expression which is self reversed

Return type:

Expression