maxframe.liteframe.LiteFrame.str.contains#

LiteFrame.str.contains(pat, case: bool = True, flags: int = 0, na=<no_default>, regex: bool = True)#

Test if pattern or regex is contained within a string of a Series or Index.

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

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

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

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

  • na (scalar, optional) – Fill value for missing values. The default depends on dtype of the array. For the "str" dtype, False is used. For object dtype, numpy.nan is used. For the nullable StringDtype, pandas.NA is used.

  • regex (bool, default True) –

    If True, assumes the pat is a regular expression.

    If False, treats the pat as a literal string.

Returns:

A Series or Index of boolean values indicating whether the given pattern is contained within the string of each element of the Series or Index.

Return type:

Series or Index of boolean values

See also

match

Analogous, but stricter, relying on re.match instead of re.search.

LiteFrame.str.startswith

Test if the start of each string element matches a pattern.

LiteFrame.str.endswith

Same as startswith, but tests the end of string.