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

Method test_ediff1d_tobegin

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

Source from the content-addressed store, hash-verified

1559 assert_equal(test.mask, control.mask)
1560
1561 def test_ediff1d_tobegin(self):
1562 # Test ediff1d w/ to_begin
1563 x = masked_array(np.arange(5), mask=[1, 0, 0, 0, 1])
1564 test = ediff1d(x, to_begin=masked)
1565 control = array([0, 1, 1, 1, 4], mask=[1, 1, 0, 0, 1])
1566 assert_equal(test, control)
1567 assert_equal(test.filled(0), control.filled(0))
1568 assert_equal(test.mask, control.mask)
1569 #
1570 test = ediff1d(x, to_begin=[1, 2, 3])
1571 control = array([1, 2, 3, 1, 1, 1, 4], mask=[0, 0, 0, 1, 0, 0, 1])
1572 assert_equal(test, control)
1573 assert_equal(test.filled(0), control.filled(0))
1574 assert_equal(test.mask, control.mask)
1575
1576 def test_ediff1d_toend(self):
1577 # Test ediff1d w/ to_end

Callers

nothing calls this directly

Calls 4

ediff1dFunction · 0.90
arrayFunction · 0.90
assert_equalFunction · 0.90
filledMethod · 0.45

Tested by

no test coverage detected