-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
ENH: Add StringMethods.partition and rpartition #9773
Conversation
What do you think of having |
+1 for defaulting to return a frame. |
OK, changed default to 'frame'. |
lgtm, but not sure when would use |
@sinhrks maybe add some examples to the docstring, and put a 'see also' to split explaining the difference. (+ a see also the the other (r)partition) |
Added docstrings (examples and see also). |
pat : string, default whitespace | ||
String to split on. | ||
return_type : {'series', 'frame'}, default 'frame' | ||
If frame, returns a DataFrame (elements are 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.
Small detail, but can you put a point .
at the end of this sentence (as in html, the line breaks are not preserved, so the following If series, ...
comes directly behind this, so without punctuation it looks strange
@jorisvandenbossche Thanks, fixed your points. About return type, I'll prepare separate PR for existing funcs which is also incorrect. |
Hmm,
First policy looks preferable, so OK to change all the descriptions like first one? I understand that these module level functions are not public. |
Yes, there is no real good solution to have it correct for both (unless starting with templating, but then the purpose of having a visual docstring you can correctly see in the source code for the module level functions is a bit lost). So I would say: most important that user sees the correct info, so I would indeed go with the first one. |
@sinhrks or, maybe what we could also do is this: replace the array with Series, and leave the module level function docstrings as is. BTW: it is not that there is a different policy in the docstrings apparently. Eg the |
b6b05a9
to
cc46330
Compare
OK, fixed this. And posting the behavior of |
looks fine. needs a rebase. |
pat : string, default whitespace | ||
String to split on. | ||
expand : bool, default True | ||
If True, return DataFrame/MultiIndex expanding dimensionality |
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 add a .
at the end of the sentence.
Or make it a list:
* If true ..
* If false ..
@jreback @jorisvandenbossche Thanks, fixed your points. Pls check again. |
Looks good! |
ENH: Add StringMethods.partition and rpartition
Derived from #9111.