done
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
from pandas.core.window.ewm import (
|
||||
ExponentialMovingWindow as ExponentialMovingWindow,
|
||||
ExponentialMovingWindowGroupby as ExponentialMovingWindowGroupby,
|
||||
)
|
||||
from pandas.core.window.expanding import (
|
||||
Expanding as Expanding,
|
||||
ExpandingGroupby as ExpandingGroupby,
|
||||
)
|
||||
from pandas.core.window.rolling import (
|
||||
Rolling as Rolling,
|
||||
RollingGroupby as RollingGroupby,
|
||||
Window as Window,
|
||||
)
|
@ -0,0 +1,69 @@
|
||||
from pandas import (
|
||||
DataFrame,
|
||||
Series,
|
||||
)
|
||||
from pandas.core.window.rolling import (
|
||||
BaseWindow,
|
||||
BaseWindowGroupby,
|
||||
)
|
||||
|
||||
from pandas._typing import (
|
||||
NDFrameT,
|
||||
WindowingEngine,
|
||||
WindowingEngineKwargs,
|
||||
)
|
||||
|
||||
class ExponentialMovingWindow(BaseWindow[NDFrameT]):
|
||||
def mean(
|
||||
self,
|
||||
numeric_only: bool = False,
|
||||
engine: WindowingEngine = None,
|
||||
engine_kwargs: WindowingEngineKwargs = None,
|
||||
) -> NDFrameT: ...
|
||||
def sum(
|
||||
self,
|
||||
numeric_only: bool = False,
|
||||
engine: WindowingEngine = None,
|
||||
engine_kwargs: WindowingEngineKwargs = None,
|
||||
) -> NDFrameT: ...
|
||||
def std(self, bias: bool = False, numeric_only: bool = False) -> NDFrameT: ...
|
||||
def var(self, bias: bool = False, numeric_only: bool = False) -> NDFrameT: ...
|
||||
def cov(
|
||||
self,
|
||||
other: DataFrame | Series | None = None,
|
||||
pairwise: bool | None = None,
|
||||
bias: bool = False,
|
||||
numeric_only: bool = False,
|
||||
) -> NDFrameT: ...
|
||||
def corr(
|
||||
self,
|
||||
other: DataFrame | Series | None = None,
|
||||
pairwise: bool | None = None,
|
||||
numeric_only: bool = False,
|
||||
) -> NDFrameT: ...
|
||||
|
||||
class ExponentialMovingWindowGroupby(
|
||||
BaseWindowGroupby[NDFrameT], ExponentialMovingWindow[NDFrameT]
|
||||
): ...
|
||||
|
||||
class OnlineExponentialMovingWindow(ExponentialMovingWindow[NDFrameT]):
|
||||
def reset(self) -> None: ...
|
||||
def aggregate(self, func, *args, **kwargs): ...
|
||||
def std(self, bias: bool = False, *args, **kwargs): ... # pyrefly: ignore
|
||||
def corr(
|
||||
self,
|
||||
other: DataFrame | Series | None = None,
|
||||
pairwise: bool | None = None,
|
||||
numeric_only: bool = False,
|
||||
): ...
|
||||
def cov(
|
||||
self,
|
||||
other: DataFrame | Series | None = None,
|
||||
pairwise: bool | None = None,
|
||||
bias: bool = False,
|
||||
numeric_only: bool = False,
|
||||
): ...
|
||||
def var(self, bias: bool = False, numeric_only: bool = False): ...
|
||||
def mean( # pyrefly: ignore
|
||||
self, *args, update: NDFrameT | None = ..., update_times: None = ..., **kwargs
|
||||
) -> NDFrameT: ...
|
@ -0,0 +1,9 @@
|
||||
from pandas.core.window.rolling import (
|
||||
BaseWindowGroupby,
|
||||
RollingAndExpandingMixin,
|
||||
)
|
||||
|
||||
from pandas._typing import NDFrameT
|
||||
|
||||
class Expanding(RollingAndExpandingMixin[NDFrameT]): ...
|
||||
class ExpandingGroupby(BaseWindowGroupby[NDFrameT], Expanding[NDFrameT]): ...
|
@ -0,0 +1,168 @@
|
||||
from collections.abc import (
|
||||
Callable,
|
||||
Iterator,
|
||||
)
|
||||
import datetime as dt
|
||||
from typing import (
|
||||
Any,
|
||||
overload,
|
||||
)
|
||||
|
||||
from pandas import (
|
||||
DataFrame,
|
||||
Index,
|
||||
Series,
|
||||
)
|
||||
from pandas.core.base import SelectionMixin
|
||||
from pandas.core.indexers import BaseIndexer
|
||||
from typing_extensions import Self
|
||||
|
||||
from pandas._libs.tslibs import BaseOffset
|
||||
from pandas._typing import (
|
||||
AggFuncTypeBase,
|
||||
AggFuncTypeFrame,
|
||||
AggFuncTypeSeriesToFrame,
|
||||
AxisInt,
|
||||
CalculationMethod,
|
||||
IntervalClosedType,
|
||||
NDFrameT,
|
||||
QuantileInterpolation,
|
||||
WindowingEngine,
|
||||
WindowingEngineKwargs,
|
||||
WindowingRankType,
|
||||
)
|
||||
|
||||
class BaseWindow(SelectionMixin[NDFrameT]):
|
||||
on: str | Index | None
|
||||
closed: IntervalClosedType | None
|
||||
step: int | None
|
||||
window: int | dt.timedelta | str | BaseOffset | BaseIndexer | None
|
||||
min_periods: int | None
|
||||
center: bool | None
|
||||
win_type: str | None
|
||||
axis: AxisInt
|
||||
method: CalculationMethod
|
||||
def __getitem__(self, key) -> Self: ...
|
||||
def __getattr__(self, attr: str) -> Self: ...
|
||||
def __iter__(self) -> Iterator[NDFrameT]: ...
|
||||
@overload
|
||||
def aggregate(
|
||||
self: BaseWindow[Series], func: AggFuncTypeBase, *args: Any, **kwargs: Any
|
||||
) -> Series: ...
|
||||
@overload
|
||||
def aggregate(
|
||||
self: BaseWindow[Series],
|
||||
func: AggFuncTypeSeriesToFrame,
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> DataFrame: ...
|
||||
@overload
|
||||
def aggregate(
|
||||
self: BaseWindow[DataFrame],
|
||||
func: AggFuncTypeFrame,
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> DataFrame: ...
|
||||
agg = aggregate
|
||||
|
||||
class BaseWindowGroupby(BaseWindow[NDFrameT]): ...
|
||||
|
||||
class Window(BaseWindow[NDFrameT]):
|
||||
def sum(self, numeric_only: bool = False, **kwargs: Any) -> NDFrameT: ...
|
||||
def mean(self, numeric_only: bool = False, **kwargs: Any) -> NDFrameT: ...
|
||||
def var(
|
||||
self, ddof: int = ..., numeric_only: bool = False, **kwargs: Any
|
||||
) -> NDFrameT: ...
|
||||
def std(
|
||||
self, ddof: int = ..., numeric_only: bool = False, **kwargs: Any
|
||||
) -> NDFrameT: ...
|
||||
|
||||
class RollingAndExpandingMixin(BaseWindow[NDFrameT]):
|
||||
def count(self, numeric_only: bool = ...) -> NDFrameT: ...
|
||||
def apply(
|
||||
self,
|
||||
func: Callable[..., Any],
|
||||
raw: bool = ...,
|
||||
engine: WindowingEngine = ...,
|
||||
engine_kwargs: WindowingEngineKwargs = ...,
|
||||
args: tuple[Any, ...] | None = ...,
|
||||
kwargs: dict[str, Any] | None = ...,
|
||||
) -> NDFrameT: ...
|
||||
def sum(
|
||||
self,
|
||||
numeric_only: bool = ...,
|
||||
engine: WindowingEngine = ...,
|
||||
engine_kwargs: WindowingEngineKwargs = ...,
|
||||
) -> NDFrameT: ...
|
||||
def max(
|
||||
self,
|
||||
numeric_only: bool = ...,
|
||||
*args,
|
||||
engine: WindowingEngine = ...,
|
||||
engine_kwargs: WindowingEngineKwargs = ...,
|
||||
) -> NDFrameT: ...
|
||||
def min(
|
||||
self,
|
||||
numeric_only: bool = ...,
|
||||
engine: WindowingEngine = ...,
|
||||
engine_kwargs: WindowingEngineKwargs = ...,
|
||||
) -> NDFrameT: ...
|
||||
def mean(
|
||||
self,
|
||||
numeric_only: bool = ...,
|
||||
engine: WindowingEngine = ...,
|
||||
engine_kwargs: WindowingEngineKwargs = ...,
|
||||
) -> NDFrameT: ...
|
||||
def median(
|
||||
self,
|
||||
numeric_only: bool = ...,
|
||||
engine: WindowingEngine = ...,
|
||||
engine_kwargs: WindowingEngineKwargs = ...,
|
||||
) -> NDFrameT: ...
|
||||
def std(
|
||||
self,
|
||||
ddof: int = ...,
|
||||
numeric_only: bool = ...,
|
||||
engine: WindowingEngine = ...,
|
||||
engine_kwargs: WindowingEngineKwargs = ...,
|
||||
) -> NDFrameT: ...
|
||||
def var(
|
||||
self,
|
||||
ddof: int = ...,
|
||||
numeric_only: bool = ...,
|
||||
engine: WindowingEngine = ...,
|
||||
engine_kwargs: WindowingEngineKwargs = ...,
|
||||
) -> NDFrameT: ...
|
||||
def skew(self, numeric_only: bool = ...) -> NDFrameT: ...
|
||||
def sem(self, ddof: int = ..., numeric_only: bool = ...) -> NDFrameT: ...
|
||||
def kurt(self, numeric_only: bool = ...) -> NDFrameT: ...
|
||||
def quantile(
|
||||
self,
|
||||
q: float,
|
||||
interpolation: QuantileInterpolation = ...,
|
||||
numeric_only: bool = ...,
|
||||
) -> NDFrameT: ...
|
||||
def rank(
|
||||
self,
|
||||
method: WindowingRankType = ...,
|
||||
ascending: bool = ...,
|
||||
pct: bool = ...,
|
||||
numeric_only: bool = ...,
|
||||
) -> NDFrameT: ...
|
||||
def cov(
|
||||
self,
|
||||
other: DataFrame | Series | None = ...,
|
||||
pairwise: bool | None = ...,
|
||||
ddof: int = ...,
|
||||
numeric_only: bool = ...,
|
||||
) -> NDFrameT: ...
|
||||
def corr(
|
||||
self,
|
||||
other: DataFrame | Series | None = ...,
|
||||
pairwise: bool | None = ...,
|
||||
ddof: int = ...,
|
||||
numeric_only: bool = ...,
|
||||
) -> NDFrameT: ...
|
||||
|
||||
class Rolling(RollingAndExpandingMixin[NDFrameT]): ...
|
||||
class RollingGroupby(BaseWindowGroupby[NDFrameT], Rolling[NDFrameT]): ...
|
Reference in New Issue
Block a user