Skip to content

Address libaggregations FIXME #44635

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 1 commit into from
Nov 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
7 changes: 5 additions & 2 deletions pandas/_libs/window/aggregations.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ from typing import (

import numpy as np

from pandas._typing import WindowingRankType
from pandas._typing import (
WindowingRankType,
npt,
)

def roll_sum(
values: np.ndarray, # const float64_t[:]
Expand Down Expand Up @@ -83,7 +86,7 @@ def roll_apply(
raw: bool,
args: tuple[Any, ...],
kwargs: dict[str, Any],
) -> np.ndarray: ... # np.ndarray[float] # FIXME: could also be type(obj) if n==0
) -> npt.NDArray[np.float64]: ...
def roll_weighted_sum(
values: np.ndarray, # const float64_t[:]
weights: np.ndarray, # const float64_t[:]
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/window/aggregations.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ def roll_apply(object obj,
Py_ssize_t i, s, e, N = len(start), n = len(obj)

if n == 0:
return obj
return np.array([], dtype=np.float64)

arr = np.asarray(obj)

Expand Down