Skip to content

Commit 0ff8968

Browse files
authored
Fix off-by-one in aggregations (#55920)
* fix off-by-one in aggregations * fix logic
1 parent 8df36a2 commit 0ff8968

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexers/objects.py

Lines changed: 1 addition & 1 deletion
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)