Exemple #1
0
 def testNdzeros(self):    
     for dtp in (numpy.int16, numpy.int32, numpy.float32, numpy.complex128):
         v = numpy.zeros(60, dtype=dtp)
         dt = numpy.dtype(dtp)
         for shape in ((60,),(6,10),(4,3,5),(2,2,3,5)):
             a1 = ndarray_ext.zeros(shape,dt)
             a2 = v.reshape(a1.shape)
             self.assertEqual(shape,a1.shape)
             self.assert_((a1 == a2).all())
Exemple #2
0
 def testNdzeros(self):    
     for dtp in (numpy.int16, numpy.int32, numpy.float32, numpy.complex128):
         v = numpy.zeros(60, dtype=dtp)
         dt = numpy.dtype(dtp)
         for shape in ((60,),(6,10),(4,3,5),(2,2,3,5)):
             a1 = ndarray_ext.zeros(shape,dt)
             a2 = v.reshape(a1.shape)
             self.assertEqual(shape,a1.shape)
             self.assert_((a1 == a2).all())