From 5d69786af46291abe727b290a84aa9d2663cd50c Mon Sep 17 00:00:00 2001 From: Linda Chen Date: Wed, 17 Jun 2020 17:11:57 -0700 Subject: [PATCH] DOC: Clarify where to the additional arguments for some win_types (#34615) * DOC: Clarify some syntax when using win_types DOC: Clarify where to the additional arguments for some win_types For example, std needs to specify when win_types is gaussian. However, std should be specified in the operation argument, not as one of the rolling arguments. This change is to clarify this point. Closes: #34593 * DOC: Clarify where to the additional arguments for some win_types Edit: 711add5 First Commit Original issue: #34615 * DOC: Clarify where to the additional arguments for some win_types Edit: a3e38ac Second Commit What's new: I shortened line 935 so that each line is less than 88 characters. Original Issue: #34615 * Revert "DOC: Clarify where to the additional arguments for some win_types" This reverts commit 45be5386b656650443404fae1842f169a65a8919. * Revert "Revert "DOC: Clarify where to the additional arguments for some win_types"" This reverts commit 05ed0eb01dcc0a4ec4743f30ba411c9fa6ee402f. * DOC: Remove whitespace in docstring * DOC: Remove indent of line934 * Update pandas/core/window/rolling.py Co-authored-by: Tom Augspurger --- pandas/core/window/rolling.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index ce0a2a9b95025..9cd750265133e 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -922,16 +922,19 @@ class Window(_Window): * ``blackmanharris`` * ``nuttall`` * ``barthann`` - * ``kaiser`` (needs beta) - * ``gaussian`` (needs std) - * ``general_gaussian`` (needs power, width) - * ``slepian`` (needs width) - * ``exponential`` (needs tau), center is set to None. + * ``kaiser`` (needs parameter: beta) + * ``gaussian`` (needs parameter: std) + * ``general_gaussian`` (needs parameters: power, width) + * ``slepian`` (needs parameter: width) + * ``exponential`` (needs parameter: tau), center is set to None. If ``win_type=None`` all points are evenly weighted. To learn more about different window types see `scipy.signal window functions `__. + Certain window types require additional parameters to be passed. Please see + the third example below on how to add the additional parameters. + Examples -------- >>> df = pd.DataFrame({'B': [0, 1, 2, np.nan, 4]})