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

Method test_setdiff1d

numpy/ma/tests/test_extras.py:1741–1752  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1739 assert_array_equal([], union1d([], []))
1740
1741 def test_setdiff1d(self):
1742 # Test setdiff1d
1743 a = array([6, 5, 4, 7, 7, 1, 2, 1], mask=[0, 0, 0, 0, 0, 0, 0, 1])
1744 b = array([2, 4, 3, 3, 2, 1, 5])
1745 test = setdiff1d(a, b)
1746 assert_equal(test, array([6, 7, -1], mask=[0, 0, 1]))
1747 #
1748 a = arange(10)
1749 b = arange(8)
1750 assert_equal(setdiff1d(a, b), array([8, 9]))
1751 a = array([], np.uint32, mask=[])
1752 assert_equal(setdiff1d(a, []).dtype, np.uint32)
1753
1754 def test_setdiff1d_char_array(self):
1755 # Test setdiff1d_charray

Callers

nothing calls this directly

Calls 3

arrayFunction · 0.90
setdiff1dFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected