Skip to content
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

Various docstring fixes #28744

Merged
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a3e4315
DOC: Fixed PR02 docstring error in pandas Series idxmin and idxmax
ChiefMilesEdgeworth Oct 1, 2019
d1f1ba0
DOC: Fixed other PR02 docstring errors in pandas Series class
ChiefMilesEdgeworth Oct 1, 2019
7fc0e35
DOC: Fixed other PR02 docstring errors in pandas rolling and ewm files
ChiefMilesEdgeworth Oct 2, 2019
cd15cec
DOC: Fixed other PR02 docstring errors in pandas plotting file
ChiefMilesEdgeworth Oct 2, 2019
51bdc5d
DOC: Fixed other PR02 docstring errors in pandas frame.py file
ChiefMilesEdgeworth Oct 2, 2019
ffe849f
Ran Black
ChiefMilesEdgeworth Oct 2, 2019
f3b9540
Flake8 Changes
ChiefMilesEdgeworth Oct 2, 2019
d5c0394
Merge branch 'master' into Various_docstring_fixes
ChiefMilesEdgeworth Oct 2, 2019
bedf748
Test fixes
ChiefMilesEdgeworth Oct 2, 2019
4d7a386
DOC: Test fixes part 2
ChiefMilesEdgeworth Oct 2, 2019
2658caf
Merge branch 'master' into Various_docstring_fixes
ChiefMilesEdgeworth Oct 2, 2019
532b53c
DOC: Update args and kwargs to same line, other small changes
ChiefMilesEdgeworth Oct 3, 2019
2f48f5a
Merge remote-tracking branch 'origin/Various_docstring_fixes' into Va…
ChiefMilesEdgeworth Oct 3, 2019
2df56a2
DOC: Missed whitespace
ChiefMilesEdgeworth Oct 3, 2019
ded2c0c
DOC: Fixing overlooked issues
ChiefMilesEdgeworth Oct 4, 2019
5263577
Merge pull request #1 from pandas-dev/master
ChiefMilesEdgeworth Oct 7, 2019
3b6f88c
Merge remote-tracking branch 'origin/master'
ChiefMilesEdgeworth Oct 8, 2019
894f7d1
Merge remote-tracking branch 'upstream/master'
ChiefMilesEdgeworth Oct 10, 2019
d687909
Merge remote-tracking branch 'upstream/master'
ChiefMilesEdgeworth Oct 11, 2019
ec3b412
Merge branch 'master' into Various_docstring_fixes
ChiefMilesEdgeworth Oct 11, 2019
494b997
DOC: Revert back to multiple parameters on one line
ChiefMilesEdgeworth Oct 15, 2019
2c723a7
Merge remote-tracking branch 'upstream/master' into Various_docstring…
ChiefMilesEdgeworth Oct 15, 2019
0507336
Merge remote-tracking branch 'upstream/master' into Various_docstring…
ChiefMilesEdgeworth Oct 15, 2019
f631cb4
DOC: Spacing fixed
ChiefMilesEdgeworth Oct 16, 2019
16fd88a
DOC: Fixed typos
ChiefMilesEdgeworth Oct 16, 2019
a5cbc8c
Update pandas/core/frame.py
ChiefMilesEdgeworth Nov 8, 2019
2a105c2
Update pandas/core/window/ewm.py
ChiefMilesEdgeworth Nov 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2614,12 +2614,9 @@ def transpose(self, *args, **kwargs):

Parameters
----------
copy : bool, default False
If True, the underlying data is copied. Otherwise (default), no
copy is made if possible.
*args, **kwargs
Additional keywords have no effect but might be accepted for
compatibility with numpy.
Additional arguments and keywords have no effect but might be
accepted for compatibility with numpy.

Returns
-------
Expand Down Expand Up @@ -3241,7 +3238,7 @@ def eval(self, expr, inplace=False, **kwargs):
If the expression contains an assignment, whether to perform the
operation inplace and mutate the existing DataFrame. Otherwise,
a new DataFrame is returned.
kwargs : dict
**kwargs
See the documentation for :func:`eval` for complete details
on the keyword arguments accepted by
:meth:`~pandas.DataFrame.query`.
Expand Down Expand Up @@ -5209,8 +5206,8 @@ def swaplevel(self, i=-2, j=-1, axis=0):

Parameters
----------
i, j : int, str (can be mixed)
datapythonista marked this conversation as resolved.
Show resolved Hide resolved
Level of index to be swapped. Can pass level name as string.
i, j: int or str
Levels indecies to be swapped. Can pass level name as string.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, indices


Returns
-------
Expand Down Expand Up @@ -6299,7 +6296,6 @@ def unstack(self, level=-1, fill_value=None):
%(versionadded)s
Parameters
----------
frame : DataFrame
id_vars : tuple, list, or ndarray, optional
Column(s) to use as identifier variables.
value_vars : tuple, list, or ndarray, optional
Expand Down
24 changes: 10 additions & 14 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2101,8 +2101,8 @@ def idxmin(self, axis=0, skipna=True, *args, **kwargs):
Exclude NA/null values. If the entire Series is NA, the result
will be NA.
*args, **kwargs
Additional keywords have no effect but might be accepted
for compatibility with NumPy.
Additional arguments and keywords have no effect but might be
accepted for compatability with NumPy.

Returns
-------
Expand Down Expand Up @@ -2171,8 +2171,8 @@ def idxmax(self, axis=0, skipna=True, *args, **kwargs):
Exclude NA/null values. If the entire Series is NA, the result
will be NA.
*args, **kwargs
Additional keywords have no effect but might be accepted
for compatibility with NumPy.
Additional arguments and keywords have no effect but might be
accepted for compatibility with NumPy.

Returns
-------
Expand Down Expand Up @@ -3544,8 +3544,8 @@ def swaplevel(self, i=-2, j=-1, copy=True):

Parameters
----------
i, j : int, str (can be mixed)
Level of index to be swapped. Can pass level name as string.
i, j : int, str
Level of the indecies to be swapped. Can pass level name as string.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same typo

copy : bool, default True
Whether to copy underlying data.

Expand Down Expand Up @@ -4099,14 +4099,10 @@ def rename(self, index=None, **kwargs):
the index.
Scalar or hashable sequence-like will alter the ``Series.name``
attribute.
copy : bool, default True
Whether to copy underlying data.
inplace : bool, default False
Whether to return a new Series. If True then value of copy is
ignored.
level : int or level name, default None
In case of a MultiIndex, only rename labels in the specified
level.

**kwargs
Additional keyword arguments passed to the function. Only the
"inplace" keyword is used.

Returns
-------
Expand Down
55 changes: 33 additions & 22 deletions pandas/core/window/ewm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,6 @@
Arguments and keyword arguments to be passed into func.
"""

_pairwise_template = """
Parameters
----------
other : Series, DataFrame, or ndarray, optional
If not supplied then will default to self and produce pairwise
output.
pairwise : bool, default None
If False then only matching columns between self and other will be
used and the output will be a DataFrame.
If True then all pairwise combinations will be calculated and the
output will be a MultiIndex DataFrame in the case of DataFrame
inputs. In the case of missing elements, only complete pairwise
observations will be used.
bias : bool, default False
Use a standard estimation bias correction.
**kwargs
Keyword arguments to be passed into func.
"""


class EWM(_Rolling):
r"""
Expand Down Expand Up @@ -276,7 +257,7 @@ def mean(self, *args, **kwargs):
Parameters
----------
*args, **kwargs
Arguments and keyword arguments to be passed into func.
Keyword arguments to be passed into func.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better revert this please.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to not resolve this and mark as resolved? I think your proposed change is incorrect, the original is more accurate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea why I missed these. I'll get them right away.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it looks like I just forgot to mark this as resolved. It should be fixed in the last commit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not reverted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason it's showing up as reverted on my machine, but not here. I'll just do the edits on Github.

ChiefMilesEdgeworth marked this conversation as resolved.
Show resolved Hide resolved
"""
nv.validate_window_func("mean", args, kwargs)
return self._apply("ewma", **kwargs)
Expand Down Expand Up @@ -317,10 +298,26 @@ def f(arg):

@Substitution(name="ewm")
@Appender(_doc_template)
@Appender(_pairwise_template)
def cov(self, other=None, pairwise=None, bias=False, **kwargs):
"""
Exponential weighted sample covariance.

Parameters
----------
other : Series, DataFrame, or ndarray, optional
If not supplied then will default to self and produce pairwise
output.
pairwise : bool, default None
If False then only matching columns between self and other will be
used and the output will be a DataFrame.
If True then all pairwise combinations will be calculated and the
output will be a MultiIndex DataFrame in the case of DataFrame
inputs. In the case of missing elements, only complete pairwise
observations will be used.
bias : bool, default False
Use a standard estimation bias correction
**kwargs
Keyword arguments to be passed into func.
"""
if other is None:
other = self._selected_obj
Expand Down Expand Up @@ -348,10 +345,24 @@ def _get_cov(X, Y):

@Substitution(name="ewm")
@Appender(_doc_template)
@Appender(_pairwise_template)
def corr(self, other=None, pairwise=None, **kwargs):
"""
Exponential weighted sample correlation.

Parameters
----------
other : Series, DataFrame, or ndarray, optional
If not supplied then will default to self and produce pairwise
output.
pairwise : bool, default None
If False then only matching columns between self and other will be
used and the output will be a DataFrame.
If True then all pairwise combinations will be calculated and the
output will be a MultiIndex DataFrame in the case of DataFrame
inputs. In the case of missing elements, only complete pairwise
observations will be used.
**kwargs
Keyword arguments to be passed into func.
"""
if other is None:
other = self._selected_obj
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/window/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ def kurt(self, **kwargs):
* higher: `j`.
* nearest: `i` or `j` whichever is nearest.
* midpoint: (`i` + `j`) / 2.
**kwargs:
**kwargs
For compatibility with other %(name)s methods. Has no effect on
the result.

Expand Down
7 changes: 4 additions & 3 deletions pandas/plotting/_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def radviz(frame, class_column, ax=None, color=None, colormap=None, **kwds):
colormap : str or :class:`matplotlib.colors.Colormap`, default None
Colormap to select colors from. If string, load colormap with that
name from matplotlib.
kwds : optional
**kwds
Options to pass to matplotlib scatter plotting method.

Returns
Expand Down Expand Up @@ -283,7 +283,7 @@ def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds):
greater or equal than the length of the `series`.
samples : int, default 500
Number of times the bootstrap procedure is performed.
**kwds :
**kwds
Options to pass to matplotlib plotting method.

Returns
Expand Down Expand Up @@ -398,7 +398,8 @@ def lag_plot(series, lag=1, ax=None, **kwds):
series : Time series
lag : lag of the scatter plot, default 1
ax : Matplotlib axis object, optional
kwds : Matplotlib scatter method keyword arguments, optional
**kwds
Matplotlib scatter method keyword arguments.

Returns
-------
Expand Down