Skip to content

TYP: aggregations.pyx #41029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions pandas/_libs/window/aggregations.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
from typing import (
Any,
Callable,
Literal,
)

import numpy as np

def roll_sum(
values: np.ndarray, # const float64_t[:]
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
) -> np.ndarray: ... # np.ndarray[float]

def roll_mean(
values: np.ndarray, # const float64_t[:]
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
) -> np.ndarray: ... # np.ndarray[float]

def roll_var(
values: np.ndarray, # const float64_t[:]
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
ddof: int = ...,
) -> np.ndarray: ... # np.ndarray[float]

def roll_skew(
values: np.ndarray, # np.ndarray[np.float64]
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
) -> np.ndarray: ... # np.ndarray[float]

def roll_kurt(
values: np.ndarray, # np.ndarray[np.float64]
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
) -> np.ndarray: ... # np.ndarray[float]

def roll_median_c(
values: np.ndarray, # np.ndarray[np.float64]
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
) -> np.ndarray: ... # np.ndarray[float]

def roll_max(
values: np.ndarray, # np.ndarray[np.float64]
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
) -> np.ndarray: ... # np.ndarray[float]

def roll_min(
values: np.ndarray, # np.ndarray[np.float64]
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
) -> np.ndarray: ... # np.ndarray[float]

def roll_quantile(
values: np.ndarray, # const float64_t[:]
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
quantile: float, # float64_t
interpolation: Literal["linear", "lower", "higher", "nearest", "midpoint"],
) -> np.ndarray: ... # np.ndarray[float]

def roll_apply(
obj: object,
start: np.ndarray, # np.ndarray[np.int64]
end: np.ndarray, # np.ndarray[np.int64]
minp: int, # int64_t
function: Callable[..., Any],
raw: bool,
args: tuple[Any, ...],
kwargs: dict[str, Any],
) -> np.ndarray: ... # np.ndarray[float] # FIXME: could also be type(obj) if n==0

def roll_weighted_sum(
values: np.ndarray, # const float64_t[:]
weights: np.ndarray, # const float64_t[:]
minp: int,
) -> np.ndarray: ... # np.ndarray[np.float64]

def roll_weighted_mean(
values: np.ndarray, # const float64_t[:]
weights: np.ndarray, # const float64_t[:]
minp: int,
) -> np.ndarray: ... # np.ndarray[np.float64]

def roll_weighted_var(
values: np.ndarray, # const float64_t[:]
weights: np.ndarray, # const float64_t[:]
minp: int, # int64_t
ddof: int, # unsigned int
) -> np.ndarray: ... # np.ndarray[np.float64]

def ewma(
vals: np.ndarray, # const float64_t[:]
start: np.ndarray, # const int64_t[:]
end: np.ndarray, # const int64_t[:]
minp: int,
com: float, # float64_t
adjust: bool,
ignore_na: bool,
deltas: np.ndarray, # const float64_t[:]
) -> np.ndarray: ... # np.ndarray[np.float64]

def ewmcov(
input_x: np.ndarray, # const float64_t[:]
start: np.ndarray, # const int64_t[:]
end: np.ndarray, # const int64_t[:]
minp: int,
input_y: np.ndarray, # const float64_t[:]
com: float, # float64_t
adjust: bool,
ignore_na: bool,
bias: bool,
) -> np.ndarray: ... # np.ndarray[np.float64]
Loading