daft.Expression.str.right

daft.Expression.str.right#

Expression.str.right(nchars: int | daft.expressions.expressions.Expression) Expression[source]#

Gets the n (from nchars) right-most characters of each string

Example

>>> import daft
>>> df = daft.from_pydict({"x": ["daft", "distributed", "engine"]})
>>> df = df.select(df["x"].str.right(4))
>>> df.show()
╭──────╮
│ x    │
│ ---  │
│ Utf8 │
╞══════╡
│ daft │
├╌╌╌╌╌╌┤
│ uted │
├╌╌╌╌╌╌┤
│ gine │
╰──────╯

(Showing first 3 of 3 rows)
Returns:

a String expression which is the n right-most characters of self

Return type:

Expression