Skip to content

Commit

Permalink
COMPAT: compare platform return on 32-bit (pandas-dev#18090)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback authored Nov 3, 2017
1 parent b4375bd commit 27bbea7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pandas/tests/test_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,13 +1243,21 @@ def test_groupsort_indexer():
result = libalgos.groupsort_indexer(a, 1000)[0]

# need to use a stable sort
# np.argsort returns int, groupsort_indexer
# always returns int64
expected = np.argsort(a, kind='mergesort')
expected = expected.astype(np.int64)

tm.assert_numpy_array_equal(result, expected)

# compare with lexsort
# np.lexsort returns int, groupsort_indexer
# always returns int64
key = a * 1000 + b
result = libalgos.groupsort_indexer(key, 1000000)[0]
expected = np.lexsort((b, a))
expected = expected.astype(np.int64)

tm.assert_numpy_array_equal(result, expected)


Expand Down

0 comments on commit 27bbea7

Please sign in to comment.