MCPcopy Create free account
hub / github.com/numpy/numpy / test_integer_split_2D_rows

Method test_integer_split_2D_rows

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

Source from the content-addressed store, hash-verified

384 compare_results(res, desired)
385
386 def test_integer_split_2D_rows(self):
387 a = np.array([np.arange(10), np.arange(10)])
388 res = array_split(a, 3, axis=0)
389 tgt = [np.array([np.arange(10)]), np.array([np.arange(10)]),
390 np.zeros((0, 10))]
391 compare_results(res, tgt)
392 assert_(a.dtype.type is res[-1].dtype.type)
393
394 # Same thing for manual splits:
395 res = array_split(a, [0, 1], axis=0)
396 tgt = [np.zeros((0, 10)), np.array([np.arange(10)]),
397 np.array([np.arange(10)])]
398 compare_results(res, tgt)
399 assert_(a.dtype.type is res[-1].dtype.type)
400
401 def test_integer_split_2D_cols(self):
402 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