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

2008-12-08 Thread Lou Pecora
In looking for simple ways to read and write data (in a text readable format) to and from a file and later restoring the actual data when reading back in, I've found that numpy arrays don't seem to play well with repr and eval. E.g. to write some data (mixed types) to a file I can do this (fp

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

2008-12-08 Thread Matthieu Brucher
Hi, The repr - eval pair does not work with numpy. You can simply do a tofile() from file(). Matthieu 2008/12/8 Lou Pecora [EMAIL PROTECTED]: In looking for simple ways to read and write data (in a text readable format) to and from a file and later restoring the actual data when reading back

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

2008-12-08 Thread Robert Kern
On Mon, Dec 8, 2008 at 14:54, Lou Pecora [EMAIL PROTECTED] wrote: In looking for simple ways to read and write data (in a text readable format) to and from a file and later restoring the actual data when reading back in, I've found that numpy arrays don't seem to play well with repr and eval.

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

2008-12-08 Thread Lou Pecora
--- On Mon, 12/8/08, Matthieu Brucher [EMAIL PROTECTED] wrote: From: Matthieu Brucher [EMAIL PROTECTED] 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

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

2008-12-08 Thread Lou Pecora
--- On Mon, 12/8/08, Robert Kern [EMAIL PROTECTED] wrote: From: Robert Kern [EMAIL PROTECTED] Subject: Re: [Numpy-discussion] What to use to read and write numpy arrays to a file? The most bulletproof way would be to use numpy.save() and numpy.load(), but this is a binary format, not a

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

2008-12-08 Thread Robert Kern
On Mon, Dec 8, 2008 at 15:26, Lou Pecora [EMAIL PROTECTED] wrote: --- On Mon, 12/8/08, Robert Kern [EMAIL PROTECTED] wrote: From: Robert Kern [EMAIL PROTECTED] Subject: Re: [Numpy-discussion] What to use to read and write numpy arrays to a file? The most bulletproof way would be to use