[Numpy-discussion] non-contiguous array error

Brad Malone brad.malone@gmail....
Sun Feb 10 19:43:05 CST 2008


Hi, I am receiving a "AttributeError: incompatible shape for a
non-contiguous array" error.  A quick illustration of the type of code
that gives me the error is shown below:
--------------------------------------------
from numpy import *
list=[i for i in range(0,27)]
c=array(list)
c.shape=(3,3,3)
d=fft.fftn(c)
d.shape=(27)
<error here>
--------------------------------------------

I suppose this has something to do with the fact that the fourier
transform of c has imaginary parts, which affects the way the
information is stored in memory, and this messed up the call to
.shape?

Is there another way to do this, or will I need to rewrite this
section of my code?

Thanks for all you do,
Brad


More information about the Numpy-discussion mailing list