pandas.Series.str.extractall¶
For each subject string in the Series, extract groups from all matches of regular expression pat. When each subject string in the Series has exactly one match, extractall(pat).xs(0, level=’match’) is the same as extract(pat).
New in version 0.18.0.
- param pat
- str
Regular expression pattern with capturing groups.
- param flags
- int, default 0 (no flags)
A
remodule flag, for examplere.IGNORECASE. These allow to modify regular expression matching for things like case, spaces, etc. Multiple flags can be combined with the bitwise OR operator, for examplere.IGNORECASE | re.MULTILINE.
- return
DataFrame A
DataFramewith one row for each match, and one column for each group. Its rows have aMultiIndexwith first levels that come from the subjectSeries. The last level is named ‘match’ and indexes the matches in each item of theSeries. Any capture group names in regular expression pat will be used for column names; otherwise capture group numbers will be used.
Warning
This feature is currently unsupported by Intel Scalable Dataframe Compiler