[Numpy-discussion] write binary data

Robert Kern robert.kern at gmail.com
Mon Sep 8 19:56:43 EDT 2008


On Mon, Sep 8, 2008 at 18:46, jinbo wang <jinbow at 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