예제 #1
0
파일: test_old_ma.py 프로젝트: numpy/numpy
    def test_testMinMax(self):
        # Test minimum and maximum.
        (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
        xr = np.ravel(x)  # max doesn't work if shaped
        xmr = ravel(xm)

        # true because of careful selection of data
        assert_(eq(max(xr), maximum.reduce(xmr)))
        assert_(eq(min(xr), minimum.reduce(xmr)))
예제 #2
0
    def test_testMinMax(self):
        # Test minimum and maximum.
        (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d
        xr = np.ravel(x)  # max doesn't work if shaped
        xmr = ravel(xm)

        # true because of careful selection of data
        assert_(eq(max(xr), maximum.reduce(xmr)))
        assert_(eq(min(xr), minimum.reduce(xmr)))
예제 #3
0
파일: test_old_ma.py 프로젝트: numpy/numpy
 def test_testMinMax2(self):
     # Test of minimum, maximum.
     assert_(eq(minimum([1, 2, 3], [4, 0, 9]), [1, 0, 3]))
     assert_(eq(maximum([1, 2, 3], [4, 0, 9]), [4, 2, 9]))
     x = arange(5)
     y = arange(5) - 2
     x[3] = masked
     y[0] = masked
     assert_(eq(minimum(x, y), where(less(x, y), x, y)))
     assert_(eq(maximum(x, y), where(greater(x, y), x, y)))
     assert_(minimum.reduce(x) == 0)
     assert_(maximum.reduce(x) == 4)
예제 #4
0
 def test_testMinMax2(self):
     # Test of minimum, maximum.
     assert_(eq(minimum([1, 2, 3], [4, 0, 9]), [1, 0, 3]))
     assert_(eq(maximum([1, 2, 3], [4, 0, 9]), [4, 2, 9]))
     x = arange(5)
     y = arange(5) - 2
     x[3] = masked
     y[0] = masked
     assert_(eq(minimum(x, y), where(less(x, y), x, y)))
     assert_(eq(maximum(x, y), where(greater(x, y), x, y)))
     assert_(minimum.reduce(x) == 0)
     assert_(maximum.reduce(x) == 4)