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

Method test_setdiff1d

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

Source from the content-addressed store, hash-verified

1676 assert_array_equal([], union1d([], []))
1677
1678 def test_setdiff1d(self):
1679 # Test setdiff1d
1680 a = array([6, 5, 4, 7, 7, 1, 2, 1], mask=[0, 0, 0, 0, 0, 0, 0, 1])
1681 b = array([2, 4, 3, 3, 2, 1, 5])
1682 test = setdiff1d(a, b)
1683 assert_equal(test, array([6, 7, -1], mask=[0, 0, 1]))
1684 #
1685 a = arange(10)
1686 b = arange(8)
1687 assert_equal(setdiff1d(a, b), array([8, 9]))
1688 a = array([], np.uint32, mask=[])
1689 assert_equal(setdiff1d(a, []).dtype, np.uint32)
1690
1691 def test_setdiff1d_char_array(self):
1692 # Test setdiff1d_charray

Callers

nothing calls this directly

Calls 4

arrayFunction · 0.90
setdiff1dFunction · 0.90
assert_equalFunction · 0.90
arangeFunction · 0.85

Tested by

no test coverage detected