[Numpy-discussion] How to resize numpy.memmap?
Sun Jun 6 14:19:35 CDT 2010
I am creating a rather large file (typically 100MBi-1GBi) with numpy.memmap
but in some cases the initial estimate to the file size is just few
bytes too small.
So, I was trying to resize the memmap with a failure as demonstrated
with the following
>>> fp = numpy.memmap('test.dat', shape=(10,), mode='w+')
>>> fp.resize(11, refcheck=False)
ValueError: cannot resize this array: it does not own its data
My question is, is there a way to "fix" this or may be there exist some other
technique to resize memmap. I have tried resizing memmap's _mmap attribute
but the size of memmap instance remains unchanged:
More information about the NumPy-Discussion