为什么numpy.memmap.flush()无法在Windows中更新文件?

时间:2019-05-05 14:37:44

标签: python numpy numpy-memmap

我目前正在将数据从磁盘复制/重新格式化为memmapped-numpy数组。 我每〜5000个元素调用一次flush(),但是Windows中的更改日期不会更改。

dimx = 400000
dimy = 100
dimz = 16
data_in: np.memmap = np.memmap(fname_input, dtype='float32', mode='r+', shape=(dimx, dimy, dimz))
for i in range(dimx):
    data = next(data_generator)
    data_in[i] = data

    if (i % 5000) is 0 and i is not 0:
        data_in.flush()
        print('changes flushed to disk.')

0 个答案:

没有答案