Skip to content

Commit 4f1313b

Browse files
author
wdyy20041223
committed
fix: resolve all ruff format issues - remove trailing whitespace and fix line lengths
1 parent b7b80d4 commit 4f1313b

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

pandas/core/generic.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9981,7 +9981,7 @@ def align(
99819981
* inner: use intersection of keys from both frames,
99829982
preserve the order of the left keys.
99839983
9984-
axis : {0 or 'index', 1 or 'columns'} for Series,
9984+
axis : {0 or 'index', 1 or 'columns'} for Series,
99859985
{0 or 'index', 1 or 'columns'} for DataFrame, default None
99869986
Align on index (0), columns (1), or both (None).
99879987
level : int or level name, default None
@@ -12698,8 +12698,9 @@ def ewm(
1269812698
[:math:`x_0, x_1, ..., x_t`] would be:
1269912699
1270012700
.. math::
12701-
y_t = \frac{x_t + (1 - \alpha)x_{t-1} + (1 - \alpha)^2 x_{t-2} + ... +
12702-
(1 - \alpha)^t x_0}{1 + (1 - \alpha) + (1 - \alpha)^2 + ... + (1 - \alpha)^t}
12701+
y_t = \\frac{x_t + (1 - \\alpha)x_{t-1} + (1 - \\alpha)^2 x_{t-2} + ... +
12702+
(1 - \\alpha)^t x_0}{1 + (1 - \\alpha) + (1 - \\alpha)^2 + ... +
12703+
(1 - \\alpha)^t}
1270312704
1270412705
- When ``adjust=False``, the exponentially weighted function is calculated
1270512706
recursively:
@@ -12714,23 +12715,24 @@ def ewm(
1271412715
1271512716
- When ``ignore_na=False`` (default), weights are based on absolute
1271612717
positions.
12717-
For example, the weights of :math:`x_0` and :math:`x_2` used in calculating
12718-
the final weighted average of [:math:`x_0`, None, :math:`x_2`] are
12719-
:math:`(1-\alpha)^2` and :math:`1` if ``adjust=True``, and
12718+
For example, the weights of :math:`x_0` and :math:`x_2` used in
12719+
calculating the final weighted average of [:math:`x_0`, None, :math:`x_2`]
12720+
are :math:`(1-\alpha)^2` and :math:`1` if ``adjust=True``, and
1272012721
:math:`(1-\alpha)^2` and :math:`\alpha` if ``adjust=False``.
1272112722
1272212723
- When ``ignore_na=True``, weights are based
12723-
on relative positions. For example, the weights of :math:`x_0` and :math:`x_2`
12724-
used in calculating the final weighted average of
12724+
on relative positions. For example, the weights of :math:`x_0` and
12725+
:math:`x_2` used in calculating the final weighted average of
1272512726
[:math:`x_0`, None, :math:`x_2`] are :math:`1-\alpha` and :math:`1` if
12726-
``adjust=True``, and :math:`1-\alpha` and :math:`\alpha` if ``adjust=False``.
12727+
``adjust=True``, and :math:`1-\alpha` and :math:`\alpha` if
12728+
``adjust=False``.
1272712729
1272812730
times : np.ndarray, Series, default None
1272912731
1273012732
Only applicable to ``mean()``.
1273112733
12732-
Times corresponding to the observations. Must be monotonically increasing and
12733-
``datetime64[ns]`` dtype.
12734+
Times corresponding to the observations. Must be monotonically increasing
12735+
and ``datetime64[ns]`` dtype.
1273412736
1273512737
If 1-D array like, a sequence with the same shape as the observations.
1273612738
@@ -12748,8 +12750,8 @@ def ewm(
1274812750
Returns
1274912751
-------
1275012752
pandas.api.typing.ExponentialMovingWindow
12751-
An instance of ExponentialMovingWindow for further exponentially weighted (EW)
12752-
calculations, e.g. using the ``mean`` method.
12753+
An instance of ExponentialMovingWindow for further exponentially weighted
12754+
(EW) calculations, e.g. using the ``mean`` method.
1275312755
1275412756
See Also
1275512757
--------
@@ -12823,10 +12825,11 @@ def ewm(
1282312825
1282412826
**times**
1282512827
12826-
Exponentially weighted mean with weights calculated with a timedelta ``halflife``
12827-
relative to ``times``.
12828+
Exponentially weighted mean with weights calculated with a timedelta
12829+
``halflife`` relative to ``times``.
1282812830
12829-
>>> times = ['2020-01-01', '2020-01-03', '2020-01-10', '2020-01-15', '2020-01-17']
12831+
>>> times = ['2020-01-01', '2020-01-03', '2020-01-10', '2020-01-15',
12832+
... '2020-01-17']
1283012833
>>> df.ewm(halflife='4 days', times=pd.DatetimeIndex(times)).mean()
1283112834
B
1283212835
0 0.000000

0 commit comments

Comments
 (0)