@@ -515,17 +515,20 @@ def f():
515515 def test_argsort (self ):
516516 c = Categorical ([5 , 3 , 1 , 4 , 2 ], ordered = True )
517517
518- expected = np .array ([2 , 4 , 1 , 3 , 0 ], dtype = np .int64 )
519- tm .assert_numpy_array_equal (c .argsort (ascending = True ), expected )
518+ expected = np .array ([2 , 4 , 1 , 3 , 0 ])
519+ tm .assert_numpy_array_equal (c .argsort (ascending = True ), expected ,
520+ check_dtype = False )
520521
521522 expected = expected [::- 1 ]
522- tm .assert_numpy_array_equal (c .argsort (ascending = False ), expected )
523+ tm .assert_numpy_array_equal (c .argsort (ascending = False ), expected ,
524+ check_dtype = False )
523525
524526 def test_numpy_argsort (self ):
525527 c = Categorical ([5 , 3 , 1 , 4 , 2 ], ordered = True )
526528
527- expected = np .array ([2 , 4 , 1 , 3 , 0 ], dtype = np .int64 )
528- tm .assert_numpy_array_equal (np .argsort (c ), expected )
529+ expected = np .array ([2 , 4 , 1 , 3 , 0 ])
530+ tm .assert_numpy_array_equal (np .argsort (c ), expected ,
531+ check_dtype = False )
529532
530533 msg = "the 'kind' parameter is not supported"
531534 tm .assertRaisesRegexp (ValueError , msg , np .argsort ,
@@ -1505,7 +1508,7 @@ def test_searchsorted(self):
15051508 # Single item array
15061509 res = c1 .searchsorted (['bread' ])
15071510 chk = s1 .searchsorted (['bread' ])
1508- exp = np .array ([1 ], dtype = np .int64 )
1511+ exp = np .array ([1 ], dtype = np .intp )
15091512 self .assert_numpy_array_equal (res , exp )
15101513 self .assert_numpy_array_equal (res , chk )
15111514
@@ -1514,21 +1517,21 @@ def test_searchsorted(self):
15141517 # np.array.searchsorted()
15151518 res = c1 .searchsorted ('bread' )
15161519 chk = s1 .searchsorted ('bread' )
1517- exp = np .array ([1 ], dtype = np .int64 )
1520+ exp = np .array ([1 ], dtype = np .intp )
15181521 self .assert_numpy_array_equal (res , exp )
15191522 self .assert_numpy_array_equal (res , chk )
15201523
15211524 # Searching for a value that is not present in the Categorical
15221525 res = c1 .searchsorted (['bread' , 'eggs' ])
15231526 chk = s1 .searchsorted (['bread' , 'eggs' ])
1524- exp = np .array ([1 , 4 ], dtype = np .int64 )
1527+ exp = np .array ([1 , 4 ], dtype = np .intp )
15251528 self .assert_numpy_array_equal (res , exp )
15261529 self .assert_numpy_array_equal (res , chk )
15271530
15281531 # Searching for a value that is not present, to the right
15291532 res = c1 .searchsorted (['bread' , 'eggs' ], side = 'right' )
15301533 chk = s1 .searchsorted (['bread' , 'eggs' ], side = 'right' )
1531- exp = np .array ([3 , 4 ], dtype = np .int64 ) # eggs before milk
1534+ exp = np .array ([3 , 4 ], dtype = np .intp ) # eggs before milk
15321535 self .assert_numpy_array_equal (res , exp )
15331536 self .assert_numpy_array_equal (res , chk )
15341537
@@ -1538,7 +1541,7 @@ def test_searchsorted(self):
15381541 chk = s2 .searchsorted (['bread' , 'eggs' ], side = 'right' ,
15391542 sorter = [0 , 1 , 2 , 3 , 5 , 4 ])
15401543 # eggs after donuts, after switching milk and donuts
1541- exp = np .array ([3 , 5 ], dtype = np .int64 )
1544+ exp = np .array ([3 , 5 ], dtype = np .intp )
15421545 self .assert_numpy_array_equal (res , exp )
15431546 self .assert_numpy_array_equal (res , chk )
15441547
0 commit comments