32
32
_doc_template = """
33
33
Returns
34
34
-------
35
- same type as input
35
+ Series or DataFrame
36
+ Return type is determined by the caller.
36
37
37
38
See Also
38
39
--------
39
- Series.%(name)s
40
- DataFrame.%(name)s
40
+ Series.%(name)s : Series %(name)s.
41
+ DataFrame.%(name)s : DataFrame %(name)s.
41
42
"""
42
43
43
44
@@ -946,13 +947,13 @@ def count(self):
946
947
return self ._wrap_results (results , blocks , obj )
947
948
948
949
_shared_docs ['apply' ] = dedent (r"""
949
- %(name)s function apply.
950
+ The %(name)s function's apply function .
950
951
951
952
Parameters
952
953
----------
953
954
func : function
954
955
Must produce a single value from an ndarray input if ``raw=True``
955
- or a Series if ``raw=False``
956
+ or a Series if ``raw=False``.
956
957
raw : bool, default None
957
958
* ``False`` : passes each row or column as a Series to the
958
959
function.
@@ -965,8 +966,19 @@ def count(self):
965
966
not passed. In the future `raw` will default to False.
966
967
967
968
.. versionadded:: 0.23.0
969
+ *args, **kwargs
970
+ Arguments and keyword arguments to be passed into func.
968
971
969
- \*args and \*\*kwargs are passed to the function""" )
972
+ Returns
973
+ -------
974
+ Series or DataFrame
975
+ Return type is determined by the caller.
976
+
977
+ See Also
978
+ --------
979
+ Series.%(name)s : Series %(name)s.
980
+ DataFrame.%(name)s : DataFrame %(name)s.
981
+ """ )
970
982
971
983
def apply (self , func , raw = None , args = (), kwargs = {}):
972
984
from pandas import Series
@@ -1005,6 +1017,11 @@ def sum(self, *args, **kwargs):
1005
1017
1006
1018
_shared_docs ['max' ] = dedent ("""
1007
1019
Calculate the %(name)s maximum.
1020
+
1021
+ Parameters
1022
+ ----------
1023
+ *args, **kwargs
1024
+ Arguments and keyword arguments to be passed into func.
1008
1025
""" )
1009
1026
1010
1027
def max (self , * args , ** kwargs ):
@@ -1227,7 +1244,14 @@ def var(self, ddof=1, *args, **kwargs):
1227
1244
check_minp = _require_min_periods (1 ), ddof = ddof ,
1228
1245
** kwargs )
1229
1246
1230
- _shared_docs ['skew' ] = """Unbiased %(name)s skewness"""
1247
+ _shared_docs ['skew' ] = """
1248
+ Unbiased %(name)s skewness.
1249
+
1250
+ Parameters
1251
+ ----------
1252
+ **kwargs
1253
+ Keyword arguments to be passed into func.
1254
+ """
1231
1255
1232
1256
def skew (self , ** kwargs ):
1233
1257
return self ._apply ('roll_skew' , 'skew' ,
@@ -1359,6 +1383,8 @@ def f(arg, *args, **kwargs):
1359
1383
ddof : int, default 1
1360
1384
Delta Degrees of Freedom. The divisor used in calculations
1361
1385
is ``N - ddof``, where ``N`` represents the number of elements.
1386
+ **kwargs
1387
+ Keyword arguments to be passed into func.
1362
1388
"""
1363
1389
1364
1390
def cov (self , other = None , pairwise = None , ddof = 1 , ** kwargs ):
@@ -1671,7 +1697,6 @@ def count(self):
1671
1697
return super (Rolling , self ).count ()
1672
1698
1673
1699
@Substitution (name = 'rolling' )
1674
- @Appender (_doc_template )
1675
1700
@Appender (_shared_docs ['apply' ])
1676
1701
def apply (self , func , raw = None , args = (), kwargs = {}):
1677
1702
return super (Rolling , self ).apply (
@@ -1945,7 +1970,6 @@ def count(self, **kwargs):
1945
1970
return super (Expanding , self ).count (** kwargs )
1946
1971
1947
1972
@Substitution (name = 'expanding' )
1948
- @Appender (_doc_template )
1949
1973
@Appender (_shared_docs ['apply' ])
1950
1974
def apply (self , func , raw = None , args = (), kwargs = {}):
1951
1975
return super (Expanding , self ).apply (
@@ -2066,7 +2090,9 @@ def _constructor(self):
2066
2090
Parameters
2067
2091
----------
2068
2092
bias : bool, default False
2069
- Use a standard estimation bias correction
2093
+ Use a standard estimation bias correction.
2094
+ *args, **kwargs
2095
+ Arguments and keyword arguments to be passed into func.
2070
2096
"""
2071
2097
2072
2098
_pairwise_template = """
@@ -2083,7 +2109,9 @@ def _constructor(self):
2083
2109
inputs. In the case of missing elements, only complete pairwise
2084
2110
observations will be used.
2085
2111
bias : bool, default False
2086
- Use a standard estimation bias correction
2112
+ Use a standard estimation bias correction.
2113
+ **kwargs
2114
+ Keyword arguments to be passed into func.
2087
2115
"""
2088
2116
2089
2117
@@ -2287,6 +2315,11 @@ def func(arg):
2287
2315
def mean (self , * args , ** kwargs ):
2288
2316
"""
2289
2317
Exponential weighted moving average.
2318
+
2319
+ Parameters
2320
+ ----------
2321
+ *args, **kwargs
2322
+ Arguments and keyword arguments to be passed into func.
2290
2323
"""
2291
2324
nv .validate_window_func ('mean' , args , kwargs )
2292
2325
return self ._apply ('ewma' , ** kwargs )
0 commit comments