[Numpy-discussion] What to use to read and write numpy arrays to a file?

Lou Pecora lou_boog2000@yahoo....
Mon Dec 8 15:24:27 CST 2008


--- On Mon, 12/8/08, Matthieu Brucher <matthieu.brucher@gmail.com> wrote:

> From: Matthieu Brucher <matthieu.brucher@gmail.com>
> Subject: Re: [Numpy-discussion] What to use to read and write numpy arrays to a file?
> To: "Discussion of Numerical Python" <numpy-discussion@scipy.org>
> Date: Monday, December 8, 2008, 3:56 PM
> Hi,
> 
> The repr - eval pair does not work with numpy. You can
> simply do a
> tofile() from file().
> 
> Matthieu

Yes, I found the tofile/fromfile pair, but they don't preserve the shape.  Sorry, I should have been clearer on that in my request.  I will be saving arrays whose shape I may not know later when I read them in.  I'd like that information to be preserved.

Thanks.

-- Lou Pecora,   my views are my own.




      


More information about the Numpy-discussion mailing list