MCPcopy
hub / github.com/pandas-dev/pandas / test_codes

Method test_codes

pandas/tests/test_sorting.py:377–386  ·  view source on GitHub ↗
(self, verify, codes, exp_codes)

Source from the content-addressed store, hash-verified

375 ],
376 )
377 def test_codes(self, verify, codes, exp_codes):
378 values = np.array([3, 1, 2, 0, 4])
379 expected = np.array([0, 1, 2, 3, 4])
380
381 result, result_codes = safe_sort(
382 values, codes, use_na_sentinel=True, verify=verify
383 )
384 expected_codes = np.array(exp_codes, dtype=np.intp)
385 tm.assert_numpy_array_equal(result, expected)
386 tm.assert_numpy_array_equal(result_codes, expected_codes)
387
388 def test_codes_out_of_bound(self):
389 values = np.array([3, 1, 2, 0, 4])

Callers

nothing calls this directly

Calls 2

safe_sortFunction · 0.90
arrayMethod · 0.45

Tested by

no test coverage detected