MCPcopy
hub / github.com/numpy/numpy / test_testMinMax2

Method test_testMinMax2

numpy/ma/tests/test_old_ma.py:527–538  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

525 assert_(eq(z, [99, 1, 1, 99, 99, 99]))
526
527 def test_testMinMax2(self):
528 # Test of minimum, maximum.
529 assert_(eq(minimum([1, 2, 3], [4, 0, 9]), [1, 0, 3]))
530 assert_(eq(maximum([1, 2, 3], [4, 0, 9]), [4, 2, 9]))
531 x = arange(5)
532 y = arange(5) - 2
533 x[3] = masked
534 y[0] = masked
535 assert_(eq(minimum(x, y), where(less(x, y), x, y)))
536 assert_(eq(maximum(x, y), where(greater(x, y), x, y)))
537 assert_(minimum.reduce(x) == 0)
538 assert_(maximum.reduce(x) == 4)
539
540 def test_testTakeTransposeInnerOuter(self):
541 # Test of take, transpose, inner, outer products

Callers

nothing calls this directly

Calls 6

assert_Function · 0.90
whereFunction · 0.90
eqFunction · 0.85
lessFunction · 0.85
greaterFunction · 0.85
reduceMethod · 0.45

Tested by

no test coverage detected