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

Method test_ediff1d_ndarray

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

Source from the content-addressed store, hash-verified

1561 assert_equal(test.mask, control.mask)
1562
1563 def test_ediff1d_ndarray(self):
1564 # Test ediff1d w/ a ndarray
1565 x = np.arange(5)
1566 test = ediff1d(x)
1567 control = array([1, 1, 1, 1], mask=[0, 0, 0, 0])
1568 assert_equal(test, control)
1569 assert_(isinstance(test, MaskedArray))
1570 assert_equal(test.filled(0), control.filled(0))
1571 assert_equal(test.mask, control.mask)
1572 #
1573 test = ediff1d(x, to_end=masked, to_begin=masked)
1574 control = array([0, 1, 1, 1, 1, 0], mask=[1, 0, 0, 0, 0, 1])
1575 assert_(isinstance(test, MaskedArray))
1576 assert_equal(test.filled(0), control.filled(0))
1577 assert_equal(test.mask, control.mask)
1578
1579 def test_intersect1d(self):
1580 # Test intersect1d

Callers

nothing calls this directly

Calls 5

ediff1dFunction · 0.90
arrayFunction · 0.90
assert_equalFunction · 0.90
assert_Function · 0.50
filledMethod · 0.45

Tested by

no test coverage detected