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

Method test_1d

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

Source from the content-addressed store, hash-verified

461 # Tests for mr_, the equivalent of r_ for masked arrays.
462
463 def test_1d(self):
464 # Tests mr_ on 1D arrays.
465 assert_array_equal(mr_[1, 2, 3, 4, 5, 6], array([1, 2, 3, 4, 5, 6]))
466 b = ones(5)
467 m = [1, 0, 0, 0, 0]
468 d = masked_array(b, mask=m)
469 c = mr_[d, 0, 0, d]
470 assert_(isinstance(c, MaskedArray))
471 assert_array_equal(c, [1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1])
472 assert_array_equal(c.mask, mr_[m, 0, 0, m])
473
474 def test_2d(self):
475 # Tests mr_ on 2D arrays.

Callers

nothing calls this directly

Calls 4

assert_array_equalFunction · 0.90
arrayFunction · 0.90
onesFunction · 0.90
assert_Function · 0.85

Tested by

no test coverage detected