Sebastian Haase wrote: > Hi, > in numarray I could do this > >>>> import numarray as na >>>> a = na.arange(10) >>>> b = na.array(a._data, type=na.int32, shape=8) >>>> > > b would use the beginning part of a. > > This is actually important for inplace FFT (where in real-to-complex-fft the > input has 2 "columns" more memory than the output) > > I found that in numpy there is no shape argument in array() at all anymore ! > > No, there is no shape argument anymore. But, the ndarray() constructor does have the shape argument and can be used in this way.
so import numpy as na b = na.ndarray(buffer=a, dtype=na.int32, shape=9) should work. -Travis ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion