diff --git a/pandas/_libs/index.pyx b/pandas/_libs/index.pyx index 9968d398e9040..741e5553141f7 100644 --- a/pandas/_libs/index.pyx +++ b/pandas/_libs/index.pyx @@ -8,7 +8,8 @@ from cpython.slice cimport PySlice_Check import numpy as np cimport numpy as cnp -from numpy cimport ndarray, float64_t, int32_t, int64_t, uint8_t, uint64_t +from numpy cimport (ndarray, float64_t, int32_t, + int64_t, uint8_t, uint64_t, intp_t) cnp.import_array() cdef extern from "numpy/arrayobject.h": @@ -183,8 +184,8 @@ cdef class IndexEngine: cdef _maybe_get_bool_indexer(self, object val): cdef: - ndarray[cnp.uint8_t, ndim=1, cast=True] indexer - ndarray[int64_t, ndim=1] found + ndarray[uint8_t, ndim=1, cast=True] indexer + ndarray[intp_t, ndim=1] found int count indexer = self._get_index_values() == val diff --git a/pandas/_libs/index_class_helper.pxi.in b/pandas/_libs/index_class_helper.pxi.in index 6f726dd49f11e..4ea35da0626f3 100644 --- a/pandas/_libs/index_class_helper.pxi.in +++ b/pandas/_libs/index_class_helper.pxi.in @@ -55,8 +55,8 @@ cdef class {{name}}Engine(IndexEngine): cdef _maybe_get_bool_indexer(self, object val): cdef: - ndarray[cnp.uint8_t, ndim=1, cast=True] indexer - ndarray[int64_t, ndim=1] found + ndarray[uint8_t, ndim=1, cast=True] indexer + ndarray[intp_t, ndim=1] found ndarray[{{ctype}}] values int count = 0