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

Method test_setdiff1d

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

Source from the content-addressed store, hash-verified

579 assert_array_equal([], union1d([], []))
580
581 def test_setdiff1d(self):
582 a = np.array([6, 5, 4, 7, 1, 2, 7, 4])
583 b = np.array([2, 4, 3, 3, 2, 1, 5])
584
585 ec = np.array([6, 7])
586 c = setdiff1d(a, b)
587 assert_array_equal(c, ec)
588
589 a = np.arange(21)
590 b = np.arange(19)
591 ec = np.array([19, 20])
592 c = setdiff1d(a, b)
593 assert_array_equal(c, ec)
594
595 assert_array_equal([], setdiff1d([], []))
596 a = np.array((), np.uint32)
597 assert_equal(setdiff1d(a, []).dtype, np.uint32)
598
599 def test_setdiff1d_unique(self):
600 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