#NEWLINE# def test_groupsort_indexer( ) : #NEWLINE# #INDENT# a = np . random . randint ( 0 , 1000 , 100 ) . astype ( np . int64 ) #NEWLINE# b = np . random . randint ( 0 , 1000 , 100 ) . astype ( np . int64 ) #NEWLINE# result = algos . groupsort_indexer ( b , 1000 ) [ 0 ] #NEWLINE# expected = np . argsort ( a , kind = 'mergesort' ) #NEWLINE# assert np . array_equal ( result , expected ) #NEWLINE# key = ( ( a * 1000 ) + b ) #NEWLINE# result = algos . groupsort_indexer ( key , 1000000 ) [ 0 ] #NEWLINE# expected = np . lexsort ( ( b , a ) ) #NEWLINE# assert np . array_equal ( result , expected )