-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Various docstring fixes #28744
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
Changes from 20 commits
a3e4315
d1f1ba0
7fc0e35
cd15cec
51bdc5d
ffe849f
f3b9540
d5c0394
bedf748
4d7a386
2658caf
532b53c
2f48f5a
2df56a2
ded2c0c
5263577
3b6f88c
894f7d1
d687909
ec3b412
494b997
2c723a7
0507336
f631cb4
16fd88a
a5cbc8c
2a105c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
------- | ||
|
@@ -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`. | ||
|
@@ -5209,8 +5206,10 @@ def swaplevel(self, i=-2, j=-1, axis=0): | |
|
||
Parameters | ||
---------- | ||
i, j : int, str (can be mixed) | ||
Level of index to be swapped. Can pass level name as string. | ||
i : int or str | ||
Level of first index to be swapped. Can pass level name as string. | ||
j : int or str | ||
Level of second index to be swapped. Can pass level name as string. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd merge those, I think the validation script should accept this, as proposed in the PR where you update it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now the proposed script does not validate any variables on the same line, just *args and **kwargs. I left it that way in case we decide we don't want people to just throw a bunch of variables on the same line. If you think that'd be fine, then I can rewrite the script update to allow for that, and change these here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the PR allowing having those together was merged, right? Can you have |
||
|
||
Returns | ||
------- | ||
|
@@ -6299,7 +6298,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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2083,8 +2083,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 | ||
------- | ||
|
@@ -2153,8 +2153,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 | ||
------- | ||
|
@@ -3525,8 +3525,10 @@ 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 : int, str | ||
Level of first index to be swapped. Can pass level name as string. | ||
j : int, str | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as before There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and you can also merge them back |
||
Level of second index to be swapped. Can pass level name as string. | ||
copy : bool, default True | ||
Whether to copy underlying data. | ||
|
||
|
@@ -4080,14 +4082,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 | ||
------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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""" | ||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better revert this please. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No idea why I missed these. I'll get them right away. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's not reverted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you revert please There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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, optional | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove the optional, and end with period. |
||
|
||
Returns | ||
------- | ||
|
Uh oh!
There was an error while loading. Please reload this page.