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,Falseis used. For object dtype,numpy.nanis used. For the nullableStringDtype,pandas.NAis 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:
See also
matchAnalogous, but stricter, relying on re.match instead of re.search.
LiteFrame.str.startswithTest if the start of each string element matches a pattern.
LiteFrame.str.endswithSame as startswith, but tests the end of string.