@@ -857,8 +857,9 @@ def str_extract(arr, pat, flags=0, expand=True):
857
857
pat : string
858
858
Regular expression pattern with capturing groups.
859
859
flags : int, default 0 (no flags)
860
- ``re`` module flags, e.g. ``re.IGNORECASE``.
861
- See :mod:`re`
860
+ Flags from the ``re`` module, e.g. ``re.IGNORECASE``, that
861
+ modify regular expression matching for things like case,
862
+ spaces, etc. For more details, see :mod:`re`.
862
863
expand : bool, default True
863
864
If True, return DataFrame with one column per capture group.
864
865
If False, return a Series/Index if there is one capture group
@@ -868,13 +869,15 @@ def str_extract(arr, pat, flags=0, expand=True):
868
869
869
870
Returns
870
871
-------
871
- DataFrame with one row for each subject string, and one column for
872
- each group. Any capture group names in regular expression pat will
873
- be used for column names; otherwise capture group numbers will be
874
- used. The dtype of each result column is always object, even when
875
- no match is found. If expand=False and pat has only one capture group,
876
- then return a Series (if subject is a Series) or Index (if subject
877
- is an Index).
872
+ DataFrame or Series or Index
873
+ A DataFrame with one row for each subject string, and one
874
+ column for each group. Any capture group names in regular
875
+ expression pat will be used for column names; otherwise
876
+ capture group numbers will be used. The dtype of each result
877
+ column is always object, even when no match is found. If
878
+ ``expand=False`` and pat has only one capture group, then
879
+ return a Series (if subject is a Series) or Index (if subject
880
+ is an Index).
878
881
879
882
See Also
880
883
--------
0 commit comments