dask.dataframe.Series.str.match

dask.dataframe.Series.str.match

dataframe.Series.str.match(pat: str, case: bool = True, flags: int = 0, na=None)

Determine if each string starts with a match of a regular expression.

This docstring was copied from pandas.core.strings.accessor.StringMethods.match.

Some inconsistencies with the Dask version may exist.

Parameters
patstr

Character sequence.

casebool, default True

If True, case sensitive.

flagsint, default 0 (no flags)

Regex module flags, e.g. re.IGNORECASE.

nascalar, optional

Fill value for missing values. The default depends on dtype of the array. For object-dtype, numpy.nan is used. For StringDtype, pandas.NA is used.

Returns
Series/Index/array of boolean values

See also

fullmatch

Stricter matching that requires the entire string to match.

contains

Analogous, but less strict, relying on re.search instead of re.match.

extract

Extract matched groups.

Examples

>>> ser = pd.Series(["horse", "eagle", "donkey"])  
>>> ser.str.match("e")  
0   False
1   True
2   False
dtype: bool