Skip to content

Commit f055be9

Browse files
BUG: Fix memory leak in Rolling.min and Rolling.max (pandas-dev#25893)
1 parent 1d4c89f commit f055be9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

doc/source/whatsnew/v0.25.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ Groupby/Resample/Rolling
372372
- Bug in :func:`pandas.core.groupby.GroupBy.agg` when applying a aggregation function to timezone aware data (:issue:`23683`)
373373
- Bug in :func:`pandas.core.groupby.GroupBy.first` and :func:`pandas.core.groupby.GroupBy.last` where timezone information would be dropped (:issue:`21603`)
374374
- Ensured that ordering of outputs in ``groupby`` aggregation functions is consistent across all versions of Python (:issue:`25692`)
375+
- Bug in :meth:`pandas.core.window.Rolling.min` and :meth:`pandas.core.window.Rolling.max` that caused a memory leak (:issue:`25893`)
375376

376377

377378
Reshaping

pandas/_libs/window.pyx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ cdef _roll_min_max(ndarray[numeric] values, int64_t win, int64_t minp,
12511251
ignoring NaNs.
12521252
"""
12531253
cdef:
1254-
ndarray[int64_t] starti, endi
1254+
int64_t[:] starti, endi
12551255
int64_t N
12561256
bint is_variable
12571257

@@ -1267,8 +1267,8 @@ cdef _roll_min_max(ndarray[numeric] values, int64_t win, int64_t minp,
12671267

12681268

12691269
cdef _roll_min_max_variable(ndarray[numeric] values,
1270-
ndarray[int64_t] starti,
1271-
ndarray[int64_t] endi,
1270+
int64_t[:] starti,
1271+
int64_t[:] endi,
12721272
int64_t N,
12731273
int64_t win,
12741274
int64_t minp,
@@ -1349,8 +1349,8 @@ cdef _roll_min_max_variable(ndarray[numeric] values,
13491349

13501350

13511351
cdef _roll_min_max_fixed(ndarray[numeric] values,
1352-
ndarray[int64_t] starti,
1353-
ndarray[int64_t] endi,
1352+
int64_t[:] starti,
1353+
int64_t[:] endi,
13541354
int64_t N,
13551355
int64_t win,
13561356
int64_t minp,

0 commit comments

Comments
 (0)