Skip to content

Commit

Permalink
COMPAT: moar 32-bit compat for testing of indexers (#16861)
Browse files Browse the repository at this point in the history
xref #16826
  • Loading branch information
jreback authored Jul 8, 2017
1 parent 18f929f commit 9c44f9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/indexes/test_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,23 +401,23 @@ 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'])
res, indexer = c.reindex(['a', 'c'])
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'])
res, indexer = c.reindex(Categorical(['a', 'c']))
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):

Expand Down

0 comments on commit 9c44f9b

Please sign in to comment.