Skip to content

Commit

Permalink
fix performance regression with time_loc_dups and Cython 3
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Nov 10, 2023
1 parent 09ed69e commit 323c13c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas/_libs/index.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cimport cython
from cpython.sequence cimport PySequence_GetItem

import numpy as np

Expand Down Expand Up @@ -437,7 +438,7 @@ cdef class IndexEngine:
d[val].append(i)

for i in range(n_t):
val = targets[i]
val = PySequence_GetItem(targets, i)

# ensure there are nas in values before looking for a matching na
if check_na_values and checknull(val):
Expand Down Expand Up @@ -996,7 +997,7 @@ cdef class SharedEngine:

# See also IntervalIndex.get_indexer_pointwise
for i in range(N):
val = targets[i]
val = PySequence_GetItem(targets, i)

try:
locs = self.get_loc(val)
Expand Down

0 comments on commit 323c13c

Please sign in to comment.