diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 3a1e76f95da5e..7e3c2200dbabc 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2640,12 +2640,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 ------- @@ -3235,7 +3232,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`. @@ -5205,8 +5202,8 @@ 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, j : int or str + Levels of the indices to be swapped. Can pass level name as string. Returns ------- @@ -6296,7 +6293,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 diff --git a/pandas/core/series.py b/pandas/core/series.py index cc7e4b81b45d4..158e22842da72 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2093,8 +2093,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 ------- @@ -2163,8 +2163,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 ------- @@ -3529,8 +3529,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 indices to be swapped. Can pass level name as string. copy : bool, default True Whether to copy underlying data. @@ -4086,14 +4086,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 ------- diff --git a/pandas/core/window/ewm.py b/pandas/core/window/ewm.py index 40e6c679ba72d..89c25c07b0dbf 100644 --- a/pandas/core/window/ewm.py +++ b/pandas/core/window/ewm.py @@ -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""" @@ -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 diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 2964a18e5d366..caf2f9e1c9dd3 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -1438,7 +1438,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. diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 8435569d8bc61..2f9c7e109f0c0 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -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 @@ -396,7 +396,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 -------