Skip to content

Commit e69709a

Browse files
committed
CLN: adding comments for when val is -1 (#35498)
1 parent 7ef6b33 commit e69709a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/_libs/index.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,16 @@ cdef class IndexEngine:
336336
n_alloc += 10_000
337337
result = np.resize(result, n_alloc)
338338

339+
# -1 in targets could be either -1 or nan
340+
# ensures values in d[-1] to be included only once
339341
if val == -1:
340342
nan_val = values_mask[j]
343+
# nan
341344
if nan_target:
342345
if nan_val:
343346
result[count] = j
344347
count += 1
348+
# -1
345349
else:
346350
if not nan_val:
347351
result[count] = j

0 commit comments

Comments
 (0)