vendredi 22 octobre 2021

How to randomize two times, whereas second time is disjoint with the first one

Let's say I want to randomize two times from set 1:1000. I want to sample two times 100 numbers, whereas on second time I cannot sample numbers drew in first drawing.

My work so far

import random
random.seed(42)
idx = [random.randint(0, 1000) for p in range(0, 100)]

And now I'm not sure how can I delete randomized indexes from numbers 0 up to 999. I tried to do:

without_idx = range(0, 999).remove(idx)

but I obtained error AttributeError: 'range' object has no attribute 'remove'

Could you please give me a hand with solving this problem?




Aucun commentaire:

Enregistrer un commentaire