diff --git a/pandas/core/window/ewm.py b/pandas/core/window/ewm.py index 0fc6c8a23f5f2..d2de7010fe536 100644 --- a/pandas/core/window/ewm.py +++ b/pandas/core/window/ewm.py @@ -273,10 +273,6 @@ def __init__( self.halflife = None self.com = get_center_of_mass(com, span, halflife, alpha) - @property - def _constructor(self): - return ExponentialMovingWindow - def _get_window_indexer(self) -> BaseIndexer: """ Return an indexer class that will compute the window start and end bounds @@ -508,6 +504,10 @@ class ExponentialMovingWindowGroupby(BaseWindowGroupby, ExponentialMovingWindow) Provide an exponential moving window groupby implementation. """ + @property + def _constructor(self): + return ExponentialMovingWindow + def _get_window_indexer(self) -> GroupbyIndexer: """ Return an indexer class that will compute the window start and end bounds diff --git a/pandas/core/window/expanding.py b/pandas/core/window/expanding.py index 94875ba86db65..f5f4dba59965c 100644 --- a/pandas/core/window/expanding.py +++ b/pandas/core/window/expanding.py @@ -64,10 +64,6 @@ class Expanding(RollingAndExpandingMixin): def __init__(self, obj, min_periods=1, center=None, axis=0, **kwargs): super().__init__(obj=obj, min_periods=min_periods, center=center, axis=axis) - @property - def _constructor(self): - return Expanding - def _get_window_indexer(self) -> BaseIndexer: """ Return an indexer class that will compute the window start and end bounds @@ -281,6 +277,10 @@ class ExpandingGroupby(BaseWindowGroupby, Expanding): Provide a expanding groupby implementation. """ + @property + def _constructor(self): + return Expanding + def _get_window_indexer(self) -> GroupbyIndexer: """ Return an indexer class that will compute the window start and end bounds diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index e6185f8ae0679..67a0cc294fe0e 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -1009,10 +1009,6 @@ class Window(BaseWindow): 2013-01-01 09:00:06 4.0 """ - @property - def _constructor(self): - return Window - def validate(self): super().validate() @@ -1884,10 +1880,6 @@ def _on(self) -> Index: "must be a column (of DataFrame), an Index or None" ) - @property - def _constructor(self): - return Rolling - def validate(self): super().validate() @@ -2143,6 +2135,10 @@ class RollingGroupby(BaseWindowGroupby, Rolling): Provide a rolling groupby implementation. """ + @property + def _constructor(self): + return Rolling + def _get_window_indexer(self) -> GroupbyIndexer: """ Return an indexer class that will compute the window start and end bounds