DataArray.str.contains(pat, case=True, flags=0, regex=True)

Test if pattern or regex is contained within each string of the array.

Return boolean array based on whether a given pattern or regex is contained within a string of the array.

  • pat (str) – Character sequence or regular expression.

  • case (bool, default: True) – If True, case sensitive.

  • flags (int, default: 0) – Flags to pass through to the re module, e.g. re.IGNORECASE. 0 means no flags.

  • regex (bool, default: True) – If True, assumes the pat is a regular expression. If False, treats the pat as a literal string.


contains (array of bool) – An array of boolean values indicating whether the given pattern is contained within the string of each element of the array.