Skip to content

Commit b67a773

Browse files
A correction to originally overlooked NaN handling in numba implementation
1 parent 1c2ce94 commit b67a773

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: pandas/core/_numba/kernels/min_max_.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ def cmp(a: Any, b: Any, is_max: bool) -> bool:
118118
Q.append(k)
119119

120120
if not Q or (this_start > valid_start):
121-
output[i] = np.nan
122-
na_pos.append(i)
121+
if values.dtype.kind != "i":
122+
output[i] = np.nan
123+
else:
124+
na_pos.append(i)
123125
elif Q[0] >= this_start:
124126
output[i] = values[Q[0]]
125127
else:

0 commit comments

Comments
 (0)