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

Method test_setdiff1d

numpy/lib/tests/test_arraysetops.py:591–607  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

589 assert_array_equal([], union1d([], []))
590
591 def test_setdiff1d(self):
592 a = np.array([6, 5, 4, 7, 1, 2, 7, 4])
593 b = np.array([2, 4, 3, 3, 2, 1, 5])
594
595 ec = np.array([6, 7])
596 c = setdiff1d(a, b)
597 assert_array_equal(c, ec)
598
599 a = np.arange(21)
600 b = np.arange(19)
601 ec = np.array([19, 20])
602 c = setdiff1d(a, b)
603 assert_array_equal(c, ec)
604
605 assert_array_equal([], setdiff1d([], []))
606 a = np.array((), np.uint32)
607 assert_equal(setdiff1d(a, []).dtype, np.uint32)
608
609 def test_setdiff1d_unique(self):
610 a = np.array([3, 2, 1])

Callers

nothing calls this directly

Calls 3

setdiff1dFunction · 0.90
assert_array_equalFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected