[SciPy-user] partially reading a file...

fred fredmfp@gmail....
Wed Aug 6 13:18:19 CDT 2008


Travis E. Oliphant a écrit :

> 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: tons of thanks ! :-))

Cheers,

-- 
Fred


More information about the SciPy-user mailing list