-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: update the DataFrame.plot.line docstring #20163
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
Line plot | ||
Plot `DataFrame` columns as lines. | ||
|
||
This function is useful to plot lines using `DataFrame`'s values |
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 sphinx complains if you do you have something right after a `. Just do DataFrame without the backticks.
pandas/plotting/_core.py
Outdated
|
||
This function is useful to plot lines using `DataFrame`'s values | ||
as coordinates. | ||
It allows to specify which columns to use for the axes. |
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 remove this line since we discuess that in the parameters section.
pandas/plotting/_core.py
Outdated
x, y : label or position, optional | ||
Coordinates for each point. | ||
`**kwds` : optional | ||
x : int, str, list of int or list of str, 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.
I think x has to be an int or str. Lists are not allowed for x, just y.
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.
We tested on Jupyter and these seem to be allowed. However, the result makes not much sense. I'm changing this, anyway.
pandas/plotting/_core.py
Outdated
Coordinates for each point. | ||
`**kwds` : optional | ||
x : int, str, list of int or list of str, optional | ||
It defines the X axis coordinates. |
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.
Remove "it". Just have "Column to use for the horizontal axis." and then the rest of your description.
pandas/plotting/_core.py
Outdated
It defines the X axis coordinates. | ||
Either the location or the label of the columns to be used. | ||
By default, it will use the `DataFrame` indices. | ||
y : int, str, list of int or list of str, 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.
I thin we write this as int, str, or list of them, optional
.
pandas/plotting/_core.py
Outdated
Either the location or the label of the columns to be used. | ||
By default, it will use the `DataFrame` indices. | ||
y : int, str, list of int or list of str, optional | ||
It defines the values to be plotted. |
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 values to be plotted."
pandas/plotting/_core.py
Outdated
y : int, str, list of int or list of str, optional | ||
It defines the values to be plotted. | ||
Either the location or the label of the columns to be used. | ||
By default, it will use the remaining `DataFrame` columns. |
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.
No backticks. Specify that it's the remaining numeric columns.
pandas/plotting/_core.py
Outdated
Keyword arguments to pass on to :py:meth:`pandas.DataFrame.plot`. | ||
|
||
Returns | ||
------- | ||
axes : matplotlib.AxesSubplot or np.array of them | ||
axes : :class:`matplotlib.AxesSubplot` or :meth:`np.array` of |
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.
:meth:np.array
-> ndarray. I don't care either way about the sphinx markup so either
:class:numpy.ndarray
or
numpy.ndarray
pandas/plotting/_core.py
Outdated
The following example shows the relationship between both | ||
populations. | ||
|
||
>>> lines = df.plot.line('pig', 'horse') |
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.
Specify x='pig', y='horse'
b58be42
to
69455a4
Compare
Fixes are up now |
Codecov Report
@@ Coverage Diff @@
## master #20163 +/- ##
=========================================
Coverage ? 91.72%
=========================================
Files ? 150
Lines ? 49152
Branches ? 0
=========================================
Hits ? 45086
Misses ? 4066
Partials ? 0
Continue to review full report at Codecov.
|
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.
Pushed a couple small updates.
Will wait to see if anyone else has thoughts, otherwise ready to merge.
Thanks @TomAugspurger ! |
Thank you! |
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.