MCPcopy
hub / github.com/numpy/numpy / test_setxor1d

Method test_setxor1d

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

Source from the content-addressed store, hash-verified

1629 assert_equal(test, control)
1630
1631 def test_setxor1d(self):
1632 # Test setxor1d
1633 a = array([1, 2, 5, 7, -1], mask=[0, 0, 0, 0, 1])
1634 b = array([1, 2, 3, 4, 5, -1], mask=[0, 0, 0, 0, 0, 1])
1635 test = setxor1d(a, b)
1636 assert_equal(test, array([3, 4, 7]))
1637 #
1638 a = array([1, 2, 5, 7, -1], mask=[0, 0, 0, 0, 1])
1639 b = [1, 2, 3, 4, 5]
1640 test = setxor1d(a, b)
1641 assert_equal(test, array([3, 4, 7, -1], mask=[0, 0, 0, 1]))
1642 #
1643 a = array([1, 2, 3])
1644 b = array([6, 5, 4])
1645 test = setxor1d(a, b)
1646 assert_(isinstance(test, MaskedArray))
1647 assert_equal(test, [1, 2, 3, 4, 5, 6])
1648 #
1649 a = array([1, 8, 2, 3], mask=[0, 1, 0, 0])
1650 b = array([6, 5, 4, 8], mask=[0, 0, 0, 1])
1651 test = setxor1d(a, b)
1652 assert_(isinstance(test, MaskedArray))
1653 assert_equal(test, [1, 2, 3, 4, 5, 6])
1654 #
1655 assert_array_equal([], setxor1d([], []))
1656
1657 def test_setxor1d_unique(self):
1658 # Test setxor1d with assume_unique=True

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected