Title: Add weighted random choice to random package
Type: Stage:
Components: Library (Lib) Versions: Python 3.5
Status: closed Resolution: duplicate
Dependencies: Superseder: allow weights in random.choice
View: 18844
Assigned To: Nosy List: dkorchem, mark.dickinson
Priority: normal Keywords:

Created on 2014-07-23 17:08 by dkorchem, last changed 2014-07-23 17:20 by mark.dickinson. This issue is now closed.

Messages (2)
msg223746 - (view) Author: Dmitry Korchemny (dkorchem) Date: 2014-07-23 17:08
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.
msg223749 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2014-07-23 17:20
Duplicate of #18844.
Date User Action Args
2014-07-23 17:20:44mark.dickinsonsetstatus: open -> closed

nosy: + mark.dickinson
messages: + msg223749

superseder: allow weights in random.choice
resolution: duplicate
2014-07-23 17:08:19dkorchemcreate