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

Method test_ediff1d_ndarray

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

Source from the content-addressed store, hash-verified

1605 assert_equal(test.mask, control.mask)
1606
1607 def test_ediff1d_ndarray(self):
1608 # Test ediff1d w/ a ndarray
1609 x = np.arange(5)
1610 test = ediff1d(x)
1611 control = array([1, 1, 1, 1], mask=[0, 0, 0, 0])
1612 assert_equal(test, control)
1613 assert_(isinstance(test, MaskedArray))
1614 assert_equal(test.filled(0), control.filled(0))
1615 assert_equal(test.mask, control.mask)
1616 #
1617 test = ediff1d(x, to_end=masked, to_begin=masked)
1618 control = array([0, 1, 1, 1, 1, 0], mask=[1, 0, 0, 0, 0, 1])
1619 assert_(isinstance(test, MaskedArray))
1620 assert_equal(test.filled(0), control.filled(0))
1621 assert_equal(test.mask, control.mask)
1622
1623 def test_intersect1d(self):
1624 # Test intersect1d

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected