Skip to content

DOC: Fix docstring of window.Expanding/Rolling.apply and document *args and **kwargs #24184

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

Merged
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
11f5027
DOC: Fix docstring formatting for pandas.core.window.Expanding.apply …
LJArendse Dec 9, 2018
9c26181
DOC: Remove trailing trailing whitespace
LJArendse Dec 9, 2018
939dfeb
DOC: Fix Line 968:80: E501 line too long (81 > 79 characters)
LJArendse Dec 9, 2018
4f1e16e
DOC: Remove * in raw parameter description
LJArendse Dec 9, 2018
764f8a8
DOC: Restore lines to original form
LJArendse Dec 9, 2018
765add7
DOC: Remove tabs
LJArendse Dec 9, 2018
ad0cd6a
DOC: Amend the description of *args, **kwargs
LJArendse Dec 9, 2018
dead755
DOC: Return _doc_template to original form, Update _shared_docs['appl…
LJArendse Dec 10, 2018
f20e951
DOC: Modify apply method's return section in docstring
LJArendse Dec 11, 2018
95c3cad
DOC: Simplify explination of the return type in apply docstring
LJArendse Dec 11, 2018
95cd423
DOC: Modify and improve on the current _doc_template
LJArendse Dec 12, 2018
a6447b5
DOC: Update _shared_docs['apply'] function description
LJArendse Dec 15, 2018
8e566a0
Merge branch 'master' into fix-docstring-formatting-for-pandas-core-w…
LJArendse Jan 3, 2019
b6cad28
DOC: Add **kwarg parameter to _shared_docs['skew']
LJArendse Jan 6, 2019
958f16f
DOC: Add *args, **kwargs parameters to _shared_docs['max'] docstring
LJArendse Jan 7, 2019
61d3a92
Add **kwargs parameter to docstrings of Rolling.cov, Expanding.cov, a…
LJArendse Jan 7, 2019
d0a5f03
DOC: Add *args, **kwargs parameters to EWM.mean docstring
LJArendse Jan 7, 2019
7c19bae
DOC: Add *args, **kwargs parameters to EWM.std docstring
LJArendse Jan 7, 2019
7cc3626
DOC: Add . to the end of the bias' parameter description
LJArendse Jan 7, 2019
8bedb9d
DOC: Remove : at the of the *args, **kwargs parameters
LJArendse Jan 7, 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
24 changes: 13 additions & 11 deletions pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@

_shared_docs = dict(**_shared_docs)
_doc_template = """
Returns
-------
same type as input

See Also
--------
Series.%(name)s
DataFrame.%(name)s
Returns
-------
same type as input

See Also
--------
Series.%(name)s : Series %(name)s.
DataFrame.%(name)s : DataFrame %(name)s.
"""


Expand Down Expand Up @@ -944,13 +945,13 @@ def count(self):
return self._wrap_results(results, blocks, obj)

_shared_docs['apply'] = dedent(r"""
%(name)s function apply.
The %(name)s function apply.

Parameters
----------
func : function
Must produce a single value from an ndarray input if ``raw=True``
or a Series if ``raw=False``
or a Series if ``raw=False``.
raw : bool, default None
* ``False`` : passes each row or column as a Series to the
function.
Expand All @@ -963,8 +964,9 @@ def count(self):
not passed. In the future `raw` will default to False.

.. versionadded:: 0.23.0

\*args and \*\*kwargs are passed to the function""")
*args, **kwargs :
Passed to the function for compatibility with other %(name)s
methods.""")

def apply(self, func, raw=None, args=(), kwargs={}):
from pandas import Series
Expand Down