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

Method test_setxor1d_unique

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

Source from the content-addressed store, hash-verified

1655 assert_array_equal([], setxor1d([], []))
1656
1657 def test_setxor1d_unique(self):
1658 # Test setxor1d with assume_unique=True
1659 a = array([1, 2, 5, 7, -1], mask=[0, 0, 0, 0, 1])
1660 b = [1, 2, 3, 4, 5]
1661 test = setxor1d(a, b, assume_unique=True)
1662 assert_equal(test, array([3, 4, 7, -1], mask=[0, 0, 0, 1]))
1663 #
1664 a = array([1, 8, 2, 3], mask=[0, 1, 0, 0])
1665 b = array([6, 5, 4, 8], mask=[0, 0, 0, 1])
1666 test = setxor1d(a, b, assume_unique=True)
1667 assert_(isinstance(test, MaskedArray))
1668 assert_equal(test, [1, 2, 3, 4, 5, 6])
1669 #
1670 a = array([[1], [8], [2], [3]])
1671 b = array([[6, 5], [4, 8]])
1672 test = setxor1d(a, b, assume_unique=True)
1673 assert_(isinstance(test, MaskedArray))
1674 assert_equal(test, [1, 2, 3, 4, 5, 6])
1675
1676 def test_isin(self):
1677 # the tests for in1d cover most of isin's behavior

Callers

nothing calls this directly

Calls 4

arrayFunction · 0.90
setxor1dFunction · 0.90
assert_equalFunction · 0.90
assert_Function · 0.85

Tested by

no test coverage detected