-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
DOC: Update the pandas.core.window.x.sum docstring #20272
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: Update the pandas.core.window.x.sum docstring #20272
Conversation
pandas/core/window.py
Outdated
Returns | ||
------- | ||
Series or DataFrame | ||
Like-indexed object containing the result of function application |
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.
Period at end
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.
Done.
pandas/core/window.py
Outdated
3 10.0 | ||
4 15.0 | ||
dtype: float64 | ||
>>> s.rolling(3, center=True).sum() |
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 this is a great example, but maybe add one line or comment for what to expect with center=True
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.
Thank you. I have added one line of explanation stating that how this argument helps.
pandas/core/window.py
Outdated
-------- | ||
Series.%(name)s : Calling object with Series data | ||
DataFrame.%(name)s : Calling object with DataFrame data | ||
Series.sum : Equivalent method for Series |
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.
Whitespace seems off on this line and below - are there more than one before the ":"?
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.
yup. Deleted.
pandas/core/window.py
Outdated
3 9.0 | ||
4 12.0 | ||
dtype: float64 | ||
>>> s.expanding(3).sum() |
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.
blank line between cases
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 have added one line for each case.
pandas/core/window.py
Outdated
@@ -639,7 +684,7 @@ def aggregate(self, arg, *args, **kwargs): | |||
agg = aggregate | |||
|
|||
@Substitution(name='window') | |||
@Appender(_doc_template) | |||
# @Appender(_doc_template) |
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.
don't comment, simply remove
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.
Your comments are valuable and I have deleted necessary code.
Changes to the pandas.core.window.x.sum docstring
Hello @apallekonda! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on March 14, 2018 at 19:29 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.
Added or deleted necessary code as per comments.
pandas/core/window.py
Outdated
@@ -639,7 +684,7 @@ def aggregate(self, arg, *args, **kwargs): | |||
agg = aggregate | |||
|
|||
@Substitution(name='window') | |||
@Appender(_doc_template) | |||
# @Appender(_doc_template) |
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.
Your comments are valuable and I have deleted necessary code.
pandas/core/window.py
Outdated
3 10.0 | ||
4 15.0 | ||
dtype: float64 | ||
>>> s.rolling(3, center=True).sum() |
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.
Thank you. I have added one line of explanation stating that how this argument helps.
pandas/core/window.py
Outdated
3 9.0 | ||
4 12.0 | ||
dtype: float64 | ||
>>> s.expanding(3).sum() |
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 have added one line for each case.
pandas/core/window.py
Outdated
-------- | ||
Series.%(name)s : Calling object with Series data | ||
DataFrame.%(name)s : Calling object with DataFrame data | ||
Series.sum : Equivalent method for Series |
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.
yup. Deleted.
pandas/core/window.py
Outdated
Returns | ||
------- | ||
Series or DataFrame | ||
Like-indexed object containing the result of function application |
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.
Done.
Codecov Report
@@ Coverage Diff @@
## master #20272 +/- ##
=========================================
Coverage ? 91.7%
=========================================
Files ? 150
Lines ? 49165
Branches ? 0
=========================================
Hits ? 45087
Misses ? 4078
Partials ? 0
Continue to review full report at Codecov.
|
[ci skip]
Thanks @apallekonda ! |
Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):
scripts/validate_docstrings.py <your-function-or-method>
git diff upstream/master -u -- "*.py" | flake8 --diff
python doc/make.py --single <your-function-or-method>
Please include the output of the validation script below between the "```" ticks:
If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.