(self)
| 5237 | assert_array_equal(idx, expected_idx) |
| 5238 | |
| 5239 | def test_object(self): # gh-6312 |
| 5240 | a = np.random.choice(10, 1000) |
| 5241 | b = np.random.choice(['abc', 'xy', 'wz', 'efghi', 'qwst', 'x'], 1000) |
| 5242 | |
| 5243 | for u in a, b: |
| 5244 | left = np.lexsort((u.astype('O'),)) |
| 5245 | right = np.argsort(u, kind='mergesort') |
| 5246 | assert_array_equal(left, right) |
| 5247 | |
| 5248 | for u, v in (a, b), (b, a): |
| 5249 | idx = np.lexsort((u, v)) |
| 5250 | assert_array_equal(idx, np.lexsort((u.astype('O'), v))) |
| 5251 | assert_array_equal(idx, np.lexsort((u, v.astype('O')))) |
| 5252 | u, v = np.array(u, dtype='object'), np.array(v, dtype='object') |
| 5253 | assert_array_equal(idx, np.lexsort((u, v))) |
| 5254 | |
| 5255 | def test_invalid_axis(self): # gh-7528 |
| 5256 | x = np.linspace(0., 1., 42*3).reshape(42, 3) |
nothing calls this directly
no test coverage detected