[issue22048] Add weighted random choice to random package

2014-07-23 Thread Mark Dickinson
Mark Dickinson added the comment: Duplicate of #18844. -- nosy: +mark.dickinson resolution: -> duplicate status: open -> closed superseder: -> allow weights in random.choice ___ Python tracker ___

[issue22048] Add weighted random choice to random package

2014-07-23 Thread Dmitry Korchemny
New submission from Dmitry Korchemny: Need to have a function for weighted randomization: given a dictionary: key -> weight (= non-negative number), return a key of the dictionary with the probability proportional to its weight. This capability is basic and is badly missing. -- compon