You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Python random.choices() function defaults to selecting an item uniformly from the collection, but optionally lets you specify a list (of the same size) of weights to make a weighted sample instead. I suspect that'll be fairly useful.
(It also lets you instead specify your weights as cumulative weights; I dunno if we really need to support both. Converting one to the other is trivial.)
The text was updated successfully, but these errors were encountered:
The Python
random.choices()
function defaults to selecting an item uniformly from the collection, but optionally lets you specify a list (of the same size) of weights to make a weighted sample instead. I suspect that'll be fairly useful.(It also lets you instead specify your weights as cumulative weights; I dunno if we really need to support both. Converting one to the other is trivial.)
The text was updated successfully, but these errors were encountered: