[Numpy-discussion] insanely slow writing to memory mapped array
Charles R Harris
charlesr.harris at gmail.com
Wed Nov 29 21:24:25 CST 2006
On 11/29/06, Mathew Yeates <myeates at jpl.nasa.gov> wrote:
>
> whoa. I just found out that A=A.transpose() does nothing but change A's
> flags from C_CONTIGUOUS to F_CONTIGUOUS!!
>
> Okay, so heres the question ...... I am reading data into the columns of
> a matrix. In order to speed this up, I want to read values into the rows
> of a matrix and when I am all done, do a transpose. Whats the best way?
And if you just want to read in the data from the file in one big contiquous
binary chunk:
>>> a = fromfile("foo.data", dtype=whatever).reshape(m,n)
Then you can make a transposed copy of a. Or even a transposed view,
depending on how you want to use it.
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20061129/5b61d5f5/attachment.html
More information about the Numpy-discussion
mailing list