[SciPy-dev] Problem with ravel for non-contiguous 1-d arrays
prabhu_r at users.sf.net
Sun Nov 20 12:35:25 CST 2005
Here is a simple example that works with numeric/numarray but fails
>>> import scipy
>>> data = scipy.array([[0,0,0,10], [1,0,0,20], [0,1,0,20], [0,0,1,30]], 'f')
>>> p = data[:,:3]
>>> z = scipy.ravel(p)
# So far so good...
>>> t = data[:,-1]
>>> z = scipy.ravel(t)
As you can see, the 1D array when ravelled does is still
non-contiguous. However, scipy.flatten does the job correctly but
always makes a copy (which is something I don't want).
Numeric/numarray work correctly.
More information about the Scipy-dev