-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: fix pr02 errors in docstrings - plot.bar, plot.barh, plot.line, plot.pie #57266
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
) -> PlotAccessor: | ||
""" | ||
Plot Series or DataFrame as lines. | ||
|
||
This function is useful to plot lines using DataFrame's values | ||
as coordinates. | ||
""" | ||
if color is not 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.
Instead can you just specify return self(..., color=color, **kwargs)
? (and likewise below)
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.
This would be prettier, but calling self(..., color=None, colormap=foo)
raises UserWarnings
for simultaneous usage of conflicting args, and the function defaults to use color=None
, ignoring the value of colormap
.
Similar situation for y
in the pieplot, which conflicts with the usage of subplots
depending on their respective values.
Thanks @noah-asing |
…plot.pie (pandas-dev#57266) * bring "color" out of kwargs in bar,barh,line function signatures to match docstring * bring "y" out of kwargs in pie function signatures to match docstring * update code_checks for fixed docstrings * change typehint from np Arraylike to Sequence to avoid dependence on np typing * Use "IndexLabel" instead of generics * rebundle args into kwargs before calling self to avoid "cannot use foo arg with bar arg" errors
Methods for
pandas.Series.plot.bar
andpandas.DataFrame.plot.bar
have the same underlying usage ofPlotAccessor
.validate_docstrings script output
1a. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.Series.plot.bar
1b. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.DataFrame.plot.bar
2a. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.Series.plot.barh
2b. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.DataFrame.plot.barh
3a. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.Series.plot.line
3b. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.DataFrame.plot.line
4a. scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.Series.plot.pie
################################################################################
################################## Validation ##################################
################################################################################
Docstring for "pandas.DataFrame.plot.pie" correct. :)
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.