diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index cefb080a3ee78..e1053c1610175 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2704,7 +2704,7 @@ def get_indexer_non_unique(self, target): tgt_values = target._values indexer, missing = self._engine.get_indexer_non_unique(tgt_values) - return indexer, missing + return _ensure_platform_int(indexer), missing def get_indexer_for(self, target, **kwargs): """ diff --git a/pandas/tests/indexes/test_category.py b/pandas/tests/indexes/test_category.py index 493274fff43e0..9dc2cfdecb98f 100644 --- a/pandas/tests/indexes/test_category.py +++ b/pandas/tests/indexes/test_category.py @@ -401,7 +401,7 @@ def test_reindex_dtype(self): exp = CategoricalIndex(['a', 'a', 'c'], categories=['a', 'c']) tm.assert_index_equal(res, exp, exact=True) tm.assert_numpy_array_equal(indexer, - np.array([0, 3, 2], dtype=np.int64)) + np.array([0, 3, 2], dtype=np.intp)) c = CategoricalIndex(['a', 'b', 'c', 'a'], categories=['a', 'b', 'c', 'd']) @@ -409,7 +409,7 @@ def test_reindex_dtype(self): exp = Index(['a', 'a', 'c'], dtype='object') tm.assert_index_equal(res, exp, exact=True) tm.assert_numpy_array_equal(indexer, - np.array([0, 3, 2], dtype=np.int64)) + np.array([0, 3, 2], dtype=np.intp)) c = CategoricalIndex(['a', 'b', 'c', 'a'], categories=['a', 'b', 'c', 'd']) @@ -417,7 +417,7 @@ def test_reindex_dtype(self): exp = CategoricalIndex(['a', 'a', 'c'], categories=['a', 'c']) tm.assert_index_equal(res, exp, exact=True) tm.assert_numpy_array_equal(indexer, - np.array([0, 3, 2], dtype=np.int64)) + np.array([0, 3, 2], dtype=np.intp)) def test_duplicates(self):