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
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |