numpy memmap memory usage - want to iterate once
问题 let say I have some big matrix saved on disk. storing it all in memory is not really feasible so I use memmap to access it A = np.memmap(filename, dtype='float32', mode='r', shape=(3000000,162)) now let say I want to iterate over this matrix (not essentially in an ordered fashion) such that each row will be accessed exactly once. p = some_permutation_of_0_to_2999999() I would like to do something like that: start = 0 end = 3000000 num_rows_to_load_at_once = some_size_that_will_fit_in_memory()