There is a random.choices(sequence, weights=None, cum_weights=None, k=1) function that can return weighted sublist of a list with replacement. There is a random.sample() that returns a random sublist without replacement but it does not take weights into account. Is there a functions that returns weighted sublist without replacement?
Aucun commentaire:
Enregistrer un commentaire