-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
DOC: Updating str_pad docstring #22570
DOC: Updating str_pad docstring #22570
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22570 +/- ##
==========================================
+ Coverage 92.04% 92.18% +0.14%
==========================================
Files 169 169
Lines 50787 50810 +23
==========================================
+ Hits 46745 46839 +94
+ Misses 4042 3971 -71
Continue to review full report at Codecov.
|
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.
Looks good, added couple of comments.
This escalated
Hello @JesperDramsch! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on September 03, 2018 at 17:10 Hours UTC |
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.
Nice docstring, added couple of comments that I think could improve it further.
@@ -1314,21 +1314,65 @@ def str_index(arr, sub, start=0, end=None, side='left'): | |||
|
|||
def str_pad(arr, width, side='left', fillchar=' '): | |||
""" | |||
Pad strings in the Series/Index with an additional character to | |||
specified side. | |||
Pad strings in the Series/Index up to width. | |||
|
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.
I think in this case we could have a extended summary, providing a bit more information on what pad means, and when it can be useful.
@JesperDramsch do you have time to address the previous comments? |
I'll get to it this weekend, I think. |
I think I addressed all comments and validated it. @datapythonista |
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.
Just couple of additional comments. Besides those, looks great.
pandas/core/strings.py
Outdated
See Also | ||
-------- | ||
Series.str.rjust: Fills the left side of strings with an arbitrary | ||
character. Equivalent to pd.str.pad(side='left'). |
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.
it's not really pd.str.pad
, but Series.str.pad
. Can you also add double backticks around it so it renders in the website as code. Same for all cases.
pandas/core/strings.py
Outdated
|
||
Parameters | ||
---------- | ||
width : int | ||
Minimum width of resulting string; additional characters will be filled | ||
with spaces | ||
with character defined in fillchar. |
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 backticks around fillchar
, so it's explicit that is the parameter name.
@JesperDramsch Pushed some last small changes. Thanks a lot for the PR! |
Added Examples to docstring.
Added documentation to each part of docstring