[Numpy-discussion] Memmap and other read/write operations

Thorsten Kranz thorstenkranz at googlemail.com
Wed Jul 30 06:51:53 EDT 2008


Hi there,

I have a question concerning numpy.memmap.

I'm working with a binary format, consisting of a header of certain size
(1024 byte)  in the beginning and a 2d-float32 array afterwards. I would
like to open the array-part using a memmap-object using

mm =
n.memmap("test.dat",dtype=n.float32,offset=1024,shape=(2000,32),mode="r+")

This works fine.

My question is now, if I can in the mean time securely open the file for
custom writing by using

f = open("test.dat", "r+")

or will there be problems? Is there another possibility to do custom writing
to the header-part?

Thanks,

Thorsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080730/0aa6215b/attachment.html>


More information about the NumPy-Discussion mailing list