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

Method test_minmax

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

Source from the content-addressed store, hash-verified

2490 assert_equal(add.reduce(a), pi)
2491
2492 def test_minmax(self):
2493 # Tests extrema on MaskedArrays.
2494 a = arange(1, 13).reshape(3, 4)
2495 amask = masked_where(a < 5, a)
2496 assert_equal(amask.max(), a.max())
2497 assert_equal(amask.min(), 5)
2498 assert_equal(amask.max(0), a.max(0))
2499 assert_equal(amask.min(0), [5, 6, 7, 8])
2500 assert_(amask.max(1)[0].mask)
2501 assert_(amask.min(1)[0].mask)
2502
2503 def test_ndarray_mask(self):
2504 # Check that the mask of the result is a ndarray (not a MaskedArray...)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected