[Numpy-discussion] memmap, write through and flush
Thu Aug 13 00:36:00 CDT 2009
> 2009/8/12 Robert Kern <email@example.com>:
> On Sat, Aug 8, 2009 at 21:33, Tom Kuiper<firstname.lastname@example.org> wrote:
>> There is something curious here. The second flush() fails. Can anyone
>> explain this?
> numpy.append() does not append values in-place. It is just a
> convenience wrapper for numpy.concatenate().
Meaning that a copy of the data is returned in an ndarray, so when you do
fp = np.append(fp, [[12,13,14,15]], 0)
The name fp is no longer bound to a memmap, hence
AttributeError: 'numpy.ndarray' object has no attribute 'flush'
More information about the NumPy-Discussion