diff --git a/pandas/_libs/index.pyx b/pandas/_libs/index.pyx index 741e5553141f7..205ab9002379d 100644 --- a/pandas/_libs/index.pyx +++ b/pandas/_libs/index.pyx @@ -195,7 +195,7 @@ cdef class IndexEngine: if count > 1: return indexer if count == 1: - return int(found[0]) + return found[0] raise KeyError(val) diff --git a/pandas/_libs/index_class_helper.pxi.in b/pandas/_libs/index_class_helper.pxi.in index 4ea35da0626f3..fc66c1c987d6e 100644 --- a/pandas/_libs/index_class_helper.pxi.in +++ b/pandas/_libs/index_class_helper.pxi.in @@ -74,7 +74,7 @@ cdef class {{name}}Engine(IndexEngine): if count > 1: return indexer if count == 1: - return int(found[0]) + return found[0] raise KeyError(val)