daft.functions.contains#
contains #
contains(expr: Expression, substr: str | Expression) -> Expression
Checks whether each string contains the given substring in a string column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr | Expression | The expression to check. | required |
substr | str | Expression | The substring to search for as a literal string, or as a column to pick values from | required |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Expression | a Boolean expression indicating whether each value contains the provided substring |
Examples:
1 2 3 4 5 | |
╭───────╮
│ x │
│ --- │
│ Bool │
╞═══════╡
│ true │
├╌╌╌╌╌╌╌┤
│ false │
├╌╌╌╌╌╌╌┤
│ false │
╰───────╯
(Showing first 3 of 3 rows) Source code in daft/functions/str.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |