[Numpy-discussion] Numeric/numpy difference

Jens Jorgen Mortensen jensj at fysik.dtu.dk
Tue Jan 24 04:45:03 EST 2006


I just discovered (the hard way) that:

 >>> import numpy
 >>> a = numpy.empty((2, 3))
 >>> a[:] = [1, 2]
 >>> a
array([[1, 2, 1],
        [2, 1, 2]])

This is with revision 1984.  With Numeric I get "ValueError: matrices 
are not aligned for copy", which I think is the correct answer.

Jens Jørgen




More information about the NumPy-Discussion mailing list