How can I shuffle a very large list stored in a file in Python?
问题 I need to deterministically generate a randomized list containing the numbers from 0 to 2^32-1. This would be the naive (and totally nonfunctional) way of doing it, just so it's clear what I'm wanting. import random numbers = range(2**32) random.seed(0) random.shuffle(numbers) I've tried making the list with numpy.arange() and using pycrypto's random.shuffle() to shuffle it. Making the list ate up about 8gb of ram, then shuffling raised that to around 25gb. I only have 32gb to give. But that