Exemplo n.º 1
0
 def test_setdiff1d(self):
     "Test setdiff1d"
     a = array([6, 5, 4, 7, 7, 1, 2, 1], mask=[0, 0, 0, 0, 0, 0, 0, 1])
     b = array([2, 4, 3, 3, 2, 1, 5])
     test = setdiff1d(a, b)
     assert_equal(test, array([6, 7, -1], mask=[0, 0, 1]))
     #
     a = arange(10)
     b = arange(8)
     assert_equal(setdiff1d(a, b), array([8, 9]))
Exemplo n.º 2
0
 def test_setdiff1d(self):
     # Test setdiff1d
     a = array([6, 5, 4, 7, 7, 1, 2, 1], mask=[0, 0, 0, 0, 0, 0, 0, 1])
     b = array([2, 4, 3, 3, 2, 1, 5])
     test = setdiff1d(a, b)
     assert_equal(test, array([6, 7, -1], mask=[0, 0, 1]))
     #
     a = arange(10)
     b = arange(8)
     assert_equal(setdiff1d(a, b), array([8, 9]))
Exemplo n.º 3
0
 def test_setdiff1d(self):
     # Test setdiff1d
     a = array([6, 5, 4, 7, 7, 1, 2, 1], mask=[0, 0, 0, 0, 0, 0, 0, 1])
     b = array([2, 4, 3, 3, 2, 1, 5])
     test = setdiff1d(a, b)
     assert_equal(test, array([6, 7, -1], mask=[0, 0, 1]))
     #
     a = arange(10)
     b = arange(8)
     assert_equal(setdiff1d(a, b), array([8, 9]))
     a = array([], np.uint32, mask=[])
     assert_equal(setdiff1d(a, []).dtype, np.uint32)
Exemplo n.º 4
0
 def test_setdiff1d_char_array(self):
     # Test setdiff1d_charray
     a = np.array(['a', 'b', 'c'])
     b = np.array(['a', 'b', 's'])
     assert_array_equal(setdiff1d(a, b), np.array(['c']))
Exemplo n.º 5
0
 def test_setdiff1d_char_array(self):
     # Test setdiff1d_charray
     a = np.array(['a', 'b', 'c'])
     b = np.array(['a', 'b', 's'])
     assert_array_equal(setdiff1d(a, b), np.array(['c']))
Exemplo n.º 6
0
 def test_setdiff1d_char_array(self):
     # Test setdiff1d_charray
     a = np.array(["a", "b", "c"])
     b = np.array(["a", "b", "s"])
     assert_array_equal(setdiff1d(a, b), np.array(["c"]))