numpy.lib.format.open_memmap not storing data

259 Views Asked by At

My numpy.lib.format.open_memmap is not storing my data. Code is below.

>>> from numpy.lib.format import open_memmap
>>> import numpy as np
>>> winners = open_memmap("winners.npy", dtype = np.str_, mode='w+', shape=(6,))
>>> winners[0] = "emma"
>>> winners
memmap(['', '', '', '', '', ''], dtype='<U0') # why is this empty?

I also tried flushing winners.

>>> winners.flush()
>>> winners
memmap(['', '', '', '', '', ''], dtype='<U0') # still empty.
0

There are 0 best solutions below