Код: Выделить всё
random.shuffle(x)
Shuffle the sequence x in place.
To shuffle an immutable sequence and return a new shuffled list, use sample(x, k=len(x)) instead.
Note that even for small len(x), the total number of permutations of x can quickly
grow larger than the period of most random number generators. This implies that most
permutations of a long sequence can never be generated. For example, a sequence of
length 2080 is the largest that can fit within the period of the Mersenne Twister
random number generator.
Интересно, является ли это тоже проблемой? это присуще выборке из больших популяций в целом. Влияет ли ограниченный период работы генераторов случайных чисел на выборку на основе веса, например, rand.choices или random.sample, если популяция большая?
Подробнее здесь: https://stackoverflow.com/questions/792 ... m-sampling
Мобильная версия