0

我目前正在将数据从磁盘复制/重新格式化到 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.')
4

0 回答 0