Skip to content

Commit 6d60803

Browse files
author
Kevin Sheppard
committed
ENH: Add step to rolling
1 parent 7b84785 commit 6d60803

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

pandas-stubs/_typing.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -302,4 +302,6 @@ class StyleExportDict(TypedDict, total=False):
302302
hide_column_names: bool
303303
css: dict[str, str | int]
304304

305+
RollingMethod = Literal["single", "table"]
306+
305307
__all__ = ["npt", "type_t"]

pandas-stubs/core/frame.pyi

+6-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ from pandas._typing import (
8484
ReadBuffer,
8585
Renamer,
8686
ReplaceMethod,
87+
RollingMethod,
8788
Scalar,
8889
ScalarT,
8990
SeriesAxisType,
@@ -1429,7 +1430,7 @@ class DataFrame(NDFrame, OpsMixin):
14291430
self,
14301431
min_periods: int = ...,
14311432
axis: AxisType = ...,
1432-
method: Literal["single", "table"] = ...,
1433+
method: RollingMethod = ...,
14331434
) -> Expanding[DataFrame]: ...
14341435
@overload
14351436
def ffill(
@@ -1771,6 +1772,8 @@ class DataFrame(NDFrame, OpsMixin):
17711772
on: Hashable | None = ...,
17721773
axis: AxisType = ...,
17731774
closed: IntervalClosedType | None = ...,
1775+
step: int | None = ...,
1776+
method: RollingMethod,
17741777
) -> Window[DataFrame]: ...
17751778
@overload
17761779
def rolling(
@@ -1783,6 +1786,8 @@ class DataFrame(NDFrame, OpsMixin):
17831786
on: Hashable | None = ...,
17841787
axis: AxisType = ...,
17851788
closed: IntervalClosedType | None = ...,
1789+
step: int | None = ...,
1790+
method: RollingMethod,
17861791
) -> Rolling[DataFrame]: ...
17871792
def rpow(
17881793
self,

pandas-stubs/core/series.pyi

+6-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ from pandas._typing import (
8888
QuantileInterpolation,
8989
Renamer,
9090
ReplaceMethod,
91+
RollingMethod,
9192
Scalar,
9293
SeriesAxisType,
9394
SortKind,
@@ -1318,7 +1319,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
13181319
self,
13191320
min_periods: int = ...,
13201321
axis: SeriesAxisType = ...,
1321-
method: Literal["single", "table"] = ...,
1322+
method: RollingMethod = ...,
13221323
) -> Expanding[Series]: ...
13231324
def floordiv(
13241325
self,
@@ -1504,6 +1505,8 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
15041505
on: _str | None = ...,
15051506
axis: SeriesAxisType = ...,
15061507
closed: _str | None = ...,
1508+
step: int | None = ...,
1509+
method: RollingMethod,
15071510
) -> Window[Series]: ...
15081511
@overload
15091512
def rolling(
@@ -1516,6 +1519,8 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
15161519
on: _str | None = ...,
15171520
axis: SeriesAxisType = ...,
15181521
closed: _str | None = ...,
1522+
step: int | None = ...,
1523+
method: RollingMethod,
15191524
) -> Rolling[Series]: ...
15201525
def rpow(
15211526
self,

pandas-stubs/core/window/ewm.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from typing import (
22
Any,
33
Generic,
4-
Literal,
54
overload,
65
)
76

@@ -18,6 +17,7 @@ from pandas._typing import (
1817
AggFuncTypeSeriesToFrame,
1918
Axis,
2019
NDFrameT,
20+
RollingMethod,
2121
TimedeltaConvertibleTypes,
2222
WindowingEngine,
2323
WindowingEngineKwargs,
@@ -36,7 +36,7 @@ class ExponentialMovingWindow(BaseWindow[NDFrameT], Generic[NDFrameT]):
3636
ignore_na: bool = ...,
3737
axis: Axis = ...,
3838
times: str | np.ndarray | Series | None = ...,
39-
method: Literal["single", "table"] = ...,
39+
method: RollingMethod = ...,
4040
) -> None: ...
4141
@overload
4242
def aggregate(

0 commit comments

Comments
 (0)