|
From: Travis O. <oli...@ie...> - 2006-01-24 16:00:48
|
Jens Jorgen Mortensen wrote: > 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. Well, not necessarily. This is consistent behavior with a[:] = 3 which fills the array with 3's. What's happening is that the array is being filled with [1,2] repeatedly (in C-contiguous order). -Travis |