-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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 11 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 |
---|---|---|
|
@@ -2610,10 +2610,10 @@ 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 | ||
*args | ||
Additional arguments have no effect but might be accepted for | ||
compatibility with numpy. | ||
**kwargs | ||
Additional keywords have no effect but might be accepted for | ||
compatibility with numpy. | ||
|
||
|
@@ -3237,7 +3237,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 : dict | ||
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. please remove the type |
||
See the documentation for :func:`eval` for complete details | ||
on the keyword arguments accepted by | ||
:meth:`~pandas.DataFrame.query`. | ||
|
@@ -5205,8 +5205,10 @@ 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 : int, str (can be mixed) | ||
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.
|
||
Level of first index to be swapped. Can pass level name as string. | ||
j : int, str (can be mixed) | ||
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 | ||
------- | ||
|
@@ -6295,7 +6297,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 |
---|---|---|
|
@@ -2076,13 +2076,16 @@ def idxmin(self, axis=0, skipna=True, *args, **kwargs): | |
|
||
Parameters | ||
---------- | ||
skipna : bool, default True | ||
Exclude NA/null values. If the entire Series is NA, the result | ||
will be NA. | ||
axis : int, default 0 | ||
For compatibility with DataFrame.idxmin. Redundant for application | ||
on Series. | ||
*args, **kwargs | ||
skipna : bool, default True | ||
Exclude NA/null values. If the entire Series is NA, the result | ||
will be NA. | ||
*args | ||
Additional arguments have no effect but might be accepted | ||
for compatability with NumPy | ||
**kwargs | ||
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. merge those please |
||
Additional keywords have no effect but might be accepted | ||
for compatibility with NumPy. | ||
|
||
|
@@ -2146,13 +2149,16 @@ def idxmax(self, axis=0, skipna=True, *args, **kwargs): | |
|
||
Parameters | ||
---------- | ||
skipna : bool, default True | ||
Exclude NA/null values. If the entire Series is NA, the result | ||
will be NA. | ||
axis : int, default 0 | ||
For compatibility with DataFrame.idxmax. Redundant for application | ||
on Series. | ||
*args, **kwargs | ||
skipna : bool, default True | ||
Exclude NA/null values. If the entire Series is NA, the result | ||
will be NA. | ||
*args | ||
Additional arguments have no effect but might be accepted | ||
for compatibility with NumPy. | ||
**kwargs | ||
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. please merge args and kwargs |
||
Additional keywords have no effect but might be accepted | ||
for compatibility with NumPy. | ||
|
||
|
@@ -3525,8 +3531,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 +4088,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 | ||
------- | ||
|
@@ -4165,6 +4169,10 @@ def drop( | |
columns : single label or list-like | ||
No change is made to the Series; use 'index' or 'labels' instead. | ||
|
||
.. versionadded:: 0.21.0 | ||
columns : None | ||
datapythonista marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Redundant for application on Series. | ||
ChiefMilesEdgeworth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.. versionadded:: 0.21.0 | ||
level : int or level name, optional | ||
For MultiIndex, level for which the labels will be removed. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,27 +17,10 @@ | |
---------- | ||
bias : bool, default False | ||
Use a standard estimation bias correction. | ||
*args, **kwargs | ||
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. | ||
*args | ||
Arguments to be passed into func. | ||
**kwargs | ||
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. merge args and kwargs |
||
""" | ||
|
||
|
||
|
@@ -275,8 +258,10 @@ def mean(self, *args, **kwargs): | |
|
||
Parameters | ||
---------- | ||
*args, **kwargs | ||
Arguments and keyword arguments to be passed into func. | ||
*args | ||
Arguments to be passed into func. | ||
**kwargs | ||
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 +302,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,11 +349,26 @@ 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 : dict of {str : Any} | ||
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. remove the type |
||
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. remove this blank line, this is probably breaking the CI |
||
if other is None: | ||
other = self._selected_obj | ||
# only default unset | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -495,7 +495,10 @@ def aggregate(self, func, *args, **kwargs): | |
|
||
Parameters | ||
---------- | ||
*args, **kwargs | ||
*args | ||
For compatibility with other %(name)s methods. Has no effect | ||
on the computed value. | ||
**kwargs | ||
For compatibility with other %(name)s methods. Has no effect | ||
on the computed value. | ||
|
||
|
@@ -1018,7 +1021,9 @@ def count(self): | |
not passed. In the future `raw` will default to False. | ||
|
||
.. versionadded:: 0.23.0 | ||
*args, **kwargs | ||
args : tuple of Any | ||
Arguments and keyword arguments to be passed into func. | ||
kwargs : dict of {str : any} | ||
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. remove the types, aren't those |
||
Arguments and keyword arguments to be passed into func. | ||
|
||
Returns | ||
|
@@ -1084,7 +1089,9 @@ def sum(self, *args, **kwargs): | |
|
||
Parameters | ||
---------- | ||
*args, **kwargs | ||
*args | ||
Arguments and keyword arguments to be passed into func. | ||
**kwargs | ||
Arguments and keyword arguments to be passed into func. | ||
""" | ||
) | ||
|
@@ -1190,7 +1197,9 @@ def median(self, **kwargs): | |
ddof : int, default 1 | ||
Delta Degrees of Freedom. The divisor used in calculations | ||
is ``N - ddof``, where ``N`` represents the number of elements. | ||
*args, **kwargs | ||
*args | ||
For NumPy compatibility. No additional arguments are used. | ||
**kwargs | ||
For NumPy compatibility. No additional arguments are used. | ||
|
||
Returns | ||
|
@@ -1265,7 +1274,9 @@ def f(arg, *args, **kwargs): | |
ddof : int, default 1 | ||
Delta Degrees of Freedom. The divisor used in calculations | ||
is ``N - ddof``, where ``N`` represents the number of elements. | ||
*args, **kwargs | ||
*args | ||
For NumPy compatibility. No additional arguments are used. | ||
**kwargs | ||
For NumPy compatibility. No additional arguments are used. | ||
|
||
Returns | ||
|
@@ -1392,7 +1403,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. | ||
|
||
|
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 : optional | ||
ChiefMilesEdgeworth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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,7 @@ 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. move this to the description, no type for star params |
||
|
||
Returns | ||
------- | ||
|
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 script is wrong in this case, please revert