MCPcopy Index your code
hub / github.com/numpy/numpy / test_integer_split_2D_rows

Method test_integer_split_2D_rows

numpy/lib/tests/test_shape_base.py:415–428  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

413 compare_results(res, desired)
414
415 def test_integer_split_2D_rows(self):
416 a = np.array([np.arange(10), np.arange(10)])
417 res = array_split(a, 3, axis=0)
418 tgt = [np.array([np.arange(10)]), np.array([np.arange(10)]),
419 np.zeros((0, 10))]
420 compare_results(res, tgt)
421 assert_(a.dtype.type is res[-1].dtype.type)
422
423 # Same thing for manual splits:
424 res = array_split(a, [0, 1], axis=0)
425 tgt = [np.zeros((0, 10)), np.array([np.arange(10)]),
426 np.array([np.arange(10)])]
427 compare_results(res, tgt)
428 assert_(a.dtype.type is res[-1].dtype.type)
429
430 def test_integer_split_2D_cols(self):
431 a = np.array([np.arange(10), np.arange(10)])

Callers

nothing calls this directly

Calls 3

array_splitFunction · 0.90
assert_Function · 0.90
compare_resultsFunction · 0.85

Tested by

no test coverage detected