Skip to content

Fix formatting in extractall example outputs #40354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pandas/core/strings/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,7 @@ def extractall(self, pat, flags=0):
0
match
A 0 1
1 2
1 2
B 0 1

Capture group names are used for column names of the result.
Expand All @@ -2359,7 +2359,7 @@ def extractall(self, pat, flags=0):
digit
match
A 0 1
1 2
1 2
B 0 1

A pattern with two groups will return a DataFrame with two columns.
Expand All @@ -2368,7 +2368,7 @@ def extractall(self, pat, flags=0):
letter digit
match
A 0 a 1
1 a 2
1 a 2
B 0 b 1

Optional groups that do not match are NaN in the result.
Expand All @@ -2377,7 +2377,7 @@ def extractall(self, pat, flags=0):
letter digit
match
A 0 a 1
1 a 2
1 a 2
B 0 b 1
C 0 NaN 1
"""
Expand Down