[Numpy-discussion] write binary data

Robert Kern robert.kern@gmail....
Mon Sep 8 18:56:43 CDT 2008


On Mon, Sep 8, 2008 at 18:46, jinbo wang <jinbow@mit.edu> wrote:
> Hi guys,
>  I am new to python, and still wondering around to solve a simple problem.
>  I have an array A, and want to save it to a binary data file with
> 'float64' and 'big-endian' specified. I searched online, but still don't
> know how to do it. I appreciate your help!

x.astype('>float64').tofile('foo.dat')

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco


More information about the Numpy-discussion mailing list