[SciPy-user] shape problem after flipud

Dominik Szczerba domi@vision.ee.ethz...
Thu Jun 14 15:47:41 CDT 2007


The following trivial codelet does not work as expected:

from scipy import *
import copy

shape = (256,256)
data = zeros(256*256)
data.shape = shape
print 'old shape', data.shape
print data

print 'new shape', data.shape

exiting with an uncomprehensive error:
AttributeError: incompatible shape for a non-contiguous array

If 'flipud' is ommited, it works as expected. I tried via a deepcopy, 
the problem persists. Why should flipud invalidate 'reshapeability'?
What am I doing wrong?

Thanks a lot for any hints,
- Dominik

Dominik Szczerba, Ph.D.
Computer Vision Lab CH-8092 Zurich

More information about the SciPy-user mailing list