-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: update Rolling.std docstring #20235
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 Rolling.std docstring #20235
Conversation
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.
Thanks for the nice PR! Added few comments
pandas/core/window.py
Outdated
%(name)s standard deviation | ||
Calculate %(name)s standard deviation. | ||
|
||
Normalized by N-1 by default. This can be changed using the ddof argument. |
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 put single backticks around ddof (like `ddof`
) (because it is a parameter name)
pandas/core/window.py
Outdated
The below example will show a rolling example | ||
|
||
>>> s = pd.Series((5,5,5,5,6,7,9,10,5,5,5,5)) | ||
>>> s.rolling(3).std(1) |
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.
if you use the default, I would leave out the 1
(just do std()
)
pandas/core/window.py
Outdated
-------- | ||
The below example will show a rolling example | ||
|
||
>>> s = pd.Series((5,5,5,5,6,7,9,10,5,5,5,5)) |
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 make this PEP8: spaces after the comma.
Also: I would maybe make it a little bit shorter, and it is more typical to use a list to construct the data instead of a tuple.
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 address the second part of the comment as well?
pandas/core/window.py
Outdated
|
||
Returns | ||
------- | ||
Returns the same object type as determined by the caller of the %(name)s |
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.
Same comment here as on the other PR #20233
pandas/core/window.py
Outdated
10 0.000000 | ||
11 0.000000 | ||
dtype: float64 | ||
>>> s.expanding(3).std() |
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
Changed a |
Ah good catch. Copy pasta fail. Thanks again! |
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.