Example #1
0
    def testByteswap(self):
        A = arange(10)
        B = A.copy()
        NE.byteswap(B)
        B = B.byteswapped()

        assert alltrue(A == B), "NE.byteswap and Numeric.array.byteswapped gave different results"
Example #2
0
    def testByteswap(self):
        A = arange(10)
        B = A.copy()
        NE.byteswap(B)
        B = B.byteswapped()

        assert alltrue(
            A == B
        ), "NE.byteswap and Numeric.array.byteswapped gave different results"
Example #3
0
 def testChangetypeC(self):
     """
     changetype(m,typecode) should have the same result as:
     m = fromstring(m.tostring(),typecode)
     """
     A = arange(26)
     B = A.copy()
     NE.changetype(A, Float)
     assert alltrue(A == fromstring(B.tostring(), Float))
Example #4
0
 def testChangetypeC(self):
     """
     changetype(m,typecode) should have the same result as:
     m = fromstring(m.tostring(),typecode)
     """       
     A = arange(26)
     B = A.copy()
     NE.changetype(A,Float)
     assert alltrue (A == fromstring(B.tostring(),Float))
Example #5
0
 def testFastclip(self):
     print "testing fastclip"
     A = arange(0, 10, 1, Float)
     B = clip(A, 3, 5)
     NE.fastclip(A, 3, 5)
     assert alltrue(A == B), "fastclip and clip gave different answers"
Example #6
0
 def testFastclip(self):
     print "testing fastclip"
     A = arange(0,10,1,Float)
     B = clip(A, 3, 5)
     NE.fastclip(A, 3, 5)
     assert alltrue(A == B), "fastclip and clip gave different answers"