-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: update the pandas.DataFrame.plot.bar docsctring #20158
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
Conversation
pandas/plotting/_core.py
Outdated
Allows plotting of one column versus another. | ||
y : label or position, default None | ||
Allows plotting of one column versus another. | ||
**kwds : optional |
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.
In our case it worked with kwds
instead of **kwds
.
https://github.com/pandas-dev/pandas/pull/20152/files#diff-2b118bda866f3d626ceb6b529c62cd1aR1977
pandas/plotting/_core.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.
The empty line here is not necessary.
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 PR, looking very good!
Added a few comments.
In the meantime, there have already been merged some related plotting PRs, so you will have to update with master:
git checkout bardoc
git fetch upstream
git merge upstream/master
should do the trick (but in the last step it might be needed to resolve conflicts)
>>> lifespan = [2, 8, 70, 1.5, 25, 12, 28] | ||
>>> index = ['snail', 'pig', 'elephant', | ||
... 'rabbit', 'giraffe', 'coyote', 'horse'] | ||
>>> df = pd.DataFrame({'speed': speed, |
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.
You don't need to redefine the dataframe here, it still knows it from the previous example
(and same below)
pandas/plotting/_core.py
Outdated
Coordinates for each point. | ||
`**kwds` : optional | ||
x : label or position, default None | ||
Allows plotting of one column versus another. |
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 specify what happens if it is not specified?
pandas/plotting/_core.py
Outdated
x, y : label or position, optional | ||
Coordinates for each point. | ||
`**kwds` : optional | ||
x : label or position, default None |
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.
the 'optional' is actually better in this case than ', default None' (but it is a gray area in the docstring guide)
pandas/plotting/_core.py
Outdated
Allows plotting of one column versus another. | ||
y : label or position, default None | ||
Allows plotting of one column versus another. | ||
**kwds : optional | ||
Keyword arguments to pass on to :py:meth:`pandas.DataFrame.plot`. |
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 rephrase this as Additional keyword arguments are documented in meth:`pandas.DataFrame.plot`
?
Codecov Report
@@ Coverage Diff @@
## master #20158 +/- ##
=======================================
Coverage 91.72% 91.72%
=======================================
Files 150 150
Lines 49165 49165
=======================================
Hits 45099 45099
Misses 4066 4066
Continue to review full report at Codecov.
|
Does it look good now? |
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 a subplots example.
Fix typo
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:
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.
Small issue with **kwds docstring