daft.Expression.str.endswith#
- Expression.str.endswith(suffix: str | daft.expressions.expressions.Expression) Expression [source]#
Checks whether each string ends with the given pattern in a string column
Example
>>> import daft >>> df = daft.from_pydict({"x": ["geftdaft", "lazy", "daft.io"]}) >>> df.with_column("match", df["x"].str.endswith("daft")).collect() ╭──────────┬─────────╮ │ x ┆ match │ │ --- ┆ --- │ │ Utf8 ┆ Boolean │ ╞══════════╪═════════╡ │ geftdaft ┆ true │ ├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │ lazy ┆ false │ ├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │ daft.io ┆ false │ ╰──────────┴─────────╯ (Showing first 3 of 3 rows)
- Parameters:
pattern – pattern to search for as a literal string, or as a column to pick values from
- Returns:
a Boolean expression indicating whether each value ends with the provided pattern
- Return type:
Expression