@@ -71,20 +71,19 @@ def test_apply_simple_series(self, data):
71
71
72
72
def test_argsort (self , data_for_sorting ):
73
73
result = pd .Series (data_for_sorting ).argsort ()
74
- expected = pd .Series (np .array ([2 , 0 , 1 ], dtype = np .int64 ))
74
+ # argsort result gets passed to take, so should be np.intp
75
+ expected = pd .Series (np .array ([2 , 0 , 1 ], dtype = np .intp ))
75
76
self .assert_series_equal (result , expected )
76
77
77
78
def test_argsort_missing_array (self , data_missing_for_sorting ):
78
79
result = data_missing_for_sorting .argsort ()
79
- expected = np .array ([2 , 0 , 1 ], dtype = np .dtype ("int" ))
80
- # we don't care whether it's int32 or int64
81
- result = result .astype ("int64" , casting = "safe" )
82
- expected = expected .astype ("int64" , casting = "safe" )
80
+ # argsort result gets passed to take, so should be np.intp
81
+ expected = np .array ([2 , 0 , 1 ], dtype = np .intp )
83
82
tm .assert_numpy_array_equal (result , expected )
84
83
85
84
def test_argsort_missing (self , data_missing_for_sorting ):
86
85
result = pd .Series (data_missing_for_sorting ).argsort ()
87
- expected = pd .Series (np .array ([1 , - 1 , 0 ], dtype = np .int64 ))
86
+ expected = pd .Series (np .array ([1 , - 1 , 0 ], dtype = np .intp ))
88
87
self .assert_series_equal (result , expected )
89
88
90
89
def test_argmin_argmax (self , data_for_sorting , data_missing_for_sorting , na_value ):
0 commit comments