-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
ENH: #9847, adding a "same" and "expand" param to StringMethods.split() #9870
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
Changes from 2 commits
38f96dd
4ede22a
df4d0ee
c8f14dd
612e0c0
d2c57da
a5e1084
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -624,6 +624,7 @@ def str_pad(arr, width, side='left', fillchar=' '): | |
|
||
def str_split(arr, pat=None, n=None, return_type='series'): | ||
""" | ||
Deprecated: return_types 'series', 'index', 'frame' are now deprecated | ||
Split each string (a la re.split) in array by given pattern, propagating NA | ||
values | ||
|
||
|
@@ -632,8 +633,8 @@ def str_split(arr, pat=None, n=None, return_type='series'): | |
pat : string, default None | ||
String or regular expression to split on. If None, splits on whitespace | ||
n : int, default None (all) | ||
return_type : {'series', 'index', 'frame', 'same', 'expand'}, default 'series' | ||
If frame or expand, returns a DataFrame (elements are strings) | ||
return_type : {'same', 'expand'}, default 'series' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be |
||
If expand, returns a DataFrame (elements are strings) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add puntcuation? (so a Also, can you quote expand (like |
||
If series, index or same, returns the same type as the original object | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would only mention 'same' here (as you did for 'frame') |
||
(elements are lists of strings). | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this comment to the
return_type
explanation?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To explain: the first sentence is used in summary tables on the API pages, so this is not what we want to show there.