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

Method test_ediff1d_tobegin

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

Source from the content-addressed store, hash-verified

1515 assert_equal(test.mask, control.mask)
1516
1517 def test_ediff1d_tobegin(self):
1518 # Test ediff1d w/ to_begin
1519 x = masked_array(np.arange(5), mask=[1, 0, 0, 0, 1])
1520 test = ediff1d(x, to_begin=masked)
1521 control = array([0, 1, 1, 1, 4], mask=[1, 1, 0, 0, 1])
1522 assert_equal(test, control)
1523 assert_equal(test.filled(0), control.filled(0))
1524 assert_equal(test.mask, control.mask)
1525 #
1526 test = ediff1d(x, to_begin=[1, 2, 3])
1527 control = array([1, 2, 3, 1, 1, 1, 4], mask=[0, 0, 0, 1, 0, 0, 1])
1528 assert_equal(test, control)
1529 assert_equal(test.filled(0), control.filled(0))
1530 assert_equal(test.mask, control.mask)
1531
1532 def test_ediff1d_toend(self):
1533 # 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