Skip to content

Commit 486c723

Browse files
Backport PR #55920 on branch 2.1.x (Fix off-by-one in aggregations) (#55942)
Backport PR #55920: Fix off-by-one in aggregations Co-authored-by: William Ayd <[email protected]>
1 parent 9bc52cb commit 486c723

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexers/objects.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def get_window_bounds(
102102
closed: str | None = None,
103103
step: int | None = None,
104104
) -> tuple[np.ndarray, np.ndarray]:
105-
if center:
105+
if center or self.window_size == 0:
106106
offset = (self.window_size - 1) // 2
107107
else:
108108
offset = 0

0 commit comments

Comments
 (0)