0

我的 numpy.lib.format.open_memmap 没有存储我的数据。代码如下。

>>> 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?

我也试过冲洗赢家。

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

0 回答 0