Expr.str.contains_any
methodView source ↗
def contains_any(patterns: td_IntoExpr, ascii_case_insensitive: bool = False) -> Expr
Categories: string
Evaluate if the string contains any of the given patterns.
Parameters
parameter
patternsThe patterns to search for.
parameter
ascii_case_insensitiveIf true, the search is case-insensitive.
Examples
>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a")
.str.contains_any(["a", "b"]).alias("contains_any"))
>>>
┌──────┬──────────────┐
│ a ┆ contains_any │
│ --- ┆ --- │
│ str ┆ bool │
╞══════╪══════════════╡
│ abc ┆ true │
│ axy ┆ true │
│ xyb ┆ true │
│ xyz ┆ false │
│ null ┆ null │
└──────┴──────────────┘