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

Method test_setxor1d

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

Source from the content-addressed store, hash-verified

1585 assert_equal(test, control)
1586
1587 def test_setxor1d(self):
1588 # Test setxor1d
1589 a = array([1, 2, 5, 7, -1], mask=[0, 0, 0, 0, 1])
1590 b = array([1, 2, 3, 4, 5, -1], mask=[0, 0, 0, 0, 0, 1])
1591 test = setxor1d(a, b)
1592 assert_equal(test, array([3, 4, 7]))
1593 #
1594 a = array([1, 2, 5, 7, -1], mask=[0, 0, 0, 0, 1])
1595 b = [1, 2, 3, 4, 5]
1596 test = setxor1d(a, b)
1597 assert_equal(test, array([3, 4, 7, -1], mask=[0, 0, 0, 1]))
1598 #
1599 a = array([1, 2, 3])
1600 b = array([6, 5, 4])
1601 test = setxor1d(a, b)
1602 assert_(isinstance(test, MaskedArray))
1603 assert_equal(test, [1, 2, 3, 4, 5, 6])
1604 #
1605 a = array([1, 8, 2, 3], mask=[0, 1, 0, 0])
1606 b = array([6, 5, 4, 8], mask=[0, 0, 0, 1])
1607 test = setxor1d(a, b)
1608 assert_(isinstance(test, MaskedArray))
1609 assert_equal(test, [1, 2, 3, 4, 5, 6])
1610 #
1611 assert_array_equal([], setxor1d([], []))
1612
1613 def test_isin(self):
1614 # the tests for in1d cover most of isin's behavior

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.50

Tested by

no test coverage detected