-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Improved the docstring of pandas.Series.sample #20109
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: Improved the docstring of pandas.Series.sample #20109
Conversation
Hello @ottiP! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on March 15, 2018 at 14:11 Hours UTC |
4b0bd50
to
5b6d02c
Compare
Thank you for your email.
I have just submitted the corrected version.
Ottavia
… Il giorno 10 mar 2018, alle ore 12:49, PEP8 Speaks ***@***.***> ha scritto:
Hello @ottiP <https://github.com/ottip>! Thanks for submitting the PR.
In the file pandas/core/generic.py <https://github.com/pandas-dev/pandas/blob/4b0bd50260c689be7553ec57053764a4cadc3cea/pandas/core/generic.py>, following are the PEP8 issues :
Line 3722:1 <https://github.com/pandas-dev/pandas/blob/4b0bd50260c689be7553ec57053764a4cadc3cea/pandas/core/generic.py#L3722>: W293 <https://duckduckgo.com/?q=pep8%20W293> blank line contains whitespace
Line 3757:1 <https://github.com/pandas-dev/pandas/blob/4b0bd50260c689be7553ec57053764a4cadc3cea/pandas/core/generic.py#L3757>: W293 <https://duckduckgo.com/?q=pep8%20W293> blank line contains whitespace
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#20109 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ARil01y5UDhn1ReSpCAFqjxNmVb-tsiNks5tc73ggaJpZM4SlP4d>.
--
------------------------
Indirizzo istituzionale di posta elettronica degli studenti e dei laureati
dell'Università degli Studi di Torino
Official University of Turin email address for students and graduates
|
pandas/core/generic.py
Outdated
Returns a random sample of items from an axis of object. | ||
Return a random sample of items from an axis of object. | ||
|
||
You can use `random state` for reproducibility |
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 since this is specifically discussing a parameter, it can be moved to the "Parameters" section. And we can mention reproducible in the examples.
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 this
pandas/core/generic.py
Outdated
|
||
Examples | ||
-------- |
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 below this line would be a good place to mention "We use a random state for reproducible results".
Do you have any interest in updating the examples to use non-random data?
That would let us run the doctest on the output.
I will add an example with random state such as it will be reproducible.
It makes sense to update examples with non random data considering the function sample is for randomness?
Thank you
Ottavia
… Il giorno 10 mar 2018, alle ore 13:14, Tom Augspurger ***@***.***> ha scritto:
@TomAugspurger commented on this pull request.
In pandas/core/generic.py <#20109 (comment)>:
>
+ Examples
+ --------
Just below this line would be a good place to mention "We use a random state for reproducible.
Do you have any interest in updating the examples to use non-random data?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#20109 (review)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ARil0yAsIm39fHvGK4rZSOXPS-FGURHuks5tc8OrgaJpZM4SlP4d>.
--
------------------------
Indirizzo istituzionale di posta elettronica degli studenti e dei laureati
dell'Università degli Studi di Torino
Official University of Turin email address for students and graduates
|
pandas/core/generic.py
Outdated
from an axis of object. | ||
DataFrame.sample : Returns a random sample of items | ||
from an axis of object. | ||
Panel.sample : Returns a random sample of items |
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 add Panel here
5b6d02c
to
3cf410a
Compare
Codecov Report
@@ Coverage Diff @@
## master #20109 +/- ##
=========================================
Coverage ? 91.7%
=========================================
Files ? 150
Lines ? 49152
Branches ? 0
=========================================
Hits ? 45074
Misses ? 4078
Partials ? 0
Continue to review full report at Codecov.
|
pandas/core/generic.py
Outdated
Returns a random sample of items from an axis of object. | ||
Return a random sample of items from an axis of object. | ||
|
||
You can use `random state` for reproducibility |
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 this
3cf410a
to
837c263
Compare
I just remove the "See also", because since this is a shared docstring for Series and DataFrame, they were pointing to "themselves". @ottiP Thanks for the PR! |
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:
The validation errors are correct because sample requires a randomic and unpredictable output.
Checklist for other PRs (remove this part if you are doing a PR for the pandas documentation sprint):