samedi 31 janvier 2015

Randomize a generator

I want to check elements of an extremely long (over a billion elements) generator for a property. Obviously it is infeasible to check all the elements (that would take roughly 400 years). Currently, they are produced in an ordered fashion. In order for the small sample that I will have time to check to be more representative of the whole thing, I would like to access the generator randomly.


Is there any way to do this (as changing it to a list and doing random.shuffle is not possible)?





Aucun commentaire:

Enregistrer un commentaire