Skip to content

np.memap won't work without mode parameter if the file does not exist yet (receipe 4.9) #3

Closed
@rndblnch

Description

@rndblnch

the memory mapping exemple will only work if the file already exists.
to make it work regardless of that, it should have the mode parameter filled:

f = np.memmap('memmapped.dat', dtype=np.float32, mode='w+', shape=(nrows, ncols))

https://github.com/ipython-books/cookbook-code/blob/master/notebooks/chapter04_optimization/09_memmap.ipynb#L61

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions