![](https://secure.gravatar.com/avatar/40489da22d2dc0cc12596420bb810463.jpg?s=120&d=mm&r=g)
6 Aug
2008
6 Aug
'08
1:14 p.m.
fred wrote:
Travis E. Oliphant a écrit :
Absolutely memory mapping still applies --- it's a perfect application for it. But, you will probably need a 64-bit system.
No problem.
Memory mapping is how the OS handles "virtual memory" which uses disk space to increase main memory. You are just using that idea directly with a memory mapped file.
Ok. Thanks for the hint.
More directly: Use numpy.memmap --- look at the docstring for example use and help on all the arguments available. But, something like this (untested): a = numpy.memmap(<filename>, mode='r', dtype=float, shape=(nx,ny,nz)) b = a[:nx/4,:ny/4,:nz/4] b.tofile(<somefilename>) Should work... -Travis