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

Method test_minmax

numpy/ma/tests/test_core.py:2682–2691  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2680 assert_equal(add.reduce(a), pi)
2681
2682 def test_minmax(self):
2683 # Tests extrema on MaskedArrays.
2684 a = arange(1, 13).reshape(3, 4)
2685 amask = masked_where(a < 5, a)
2686 assert_equal(amask.max(), a.max())
2687 assert_equal(amask.min(), 5)
2688 assert_equal(amask.max(0), a.max(0))
2689 assert_equal(amask.min(0), [5, 6, 7, 8])
2690 assert_(amask.max(1)[0].mask)
2691 assert_(amask.min(1)[0].mask)
2692
2693 def test_ndarray_mask(self):
2694 # Check that the mask of the result is a ndarray (not a MaskedArray...)

Callers

nothing calls this directly

Calls 6

masked_whereFunction · 0.90
assert_equalFunction · 0.90
assert_Function · 0.85
reshapeMethod · 0.80
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected