On 10.10.2013 15:07, Joe Kington wrote:
> You just need to supply the "offset" kwarg to "memmap".
>
> for example:
>
> with open(localfile, "r") as fd:
> # read offset from first line of file
> offset = int(next(fd).split()[-2])
> np.memmap(fd, dtype="float32", mode="r", offset=offset)
>
>
On 10.10.2013 14:57, Julian Taylor wrote:
> you have to use the offset keyword argument of np.memmap, else it will
> always start from the beginning of the file
>
np.memmap(fd, dtype="float32", mode="r", offset=offset)
Thanks for that! I just proposed an update to the memmap docstring to
bet
You just need to supply the "offset" kwarg to "memmap".
for example:
with open(localfile, "r") as fd:
# read offset from first line of file
offset = int(next(fd).split()[-2])
np.memmap(fd, dtype="float32", mode="r", offset=offset)
Also, there's no need to do things like "offset =
int(fd.re
you have to use the offset keyword argument of np.memmap, else it will
always start from the beginning of the file
>>> np.memmap(fd, dtype="float32", mode="r", offset=offset)
On Thu, Oct 10, 2013 at 2:43 PM, Andreas Hilboll wrote:
> Hi,
>
> I have a problem using memmap correctly. I need to re
Hi,
I have a problem using memmap correctly. I need to read a data file
which consists of an ASCII header and appended binary single precision
floating point values. memmap complains that the "Size of available data
is not a multiple of the data-type size." But as far as I can tell, the
size *doas