Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weighted random choice to random package #66247

Closed
dkorchem mannequin opened this issue Jul 23, 2014 · 2 comments
Closed

Add weighted random choice to random package #66247

dkorchem mannequin opened this issue Jul 23, 2014 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@dkorchem
Copy link
Mannequin

dkorchem mannequin commented Jul 23, 2014

BPO 22048
Nosy @mdickinson
Superseder
  • bpo-18844: allow weights in random.choice
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-07-23.17:20:44.912>
    created_at = <Date 2014-07-23.17:08:19.696>
    labels = ['library']
    title = 'Add weighted random choice to random package'
    updated_at = <Date 2014-07-23.17:20:44.867>
    user = 'https://bugs.python.org/dkorchem'

    bugs.python.org fields:

    activity = <Date 2014-07-23.17:20:44.867>
    actor = 'mark.dickinson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-07-23.17:20:44.912>
    closer = 'mark.dickinson'
    components = ['Library (Lib)']
    creation = <Date 2014-07-23.17:08:19.696>
    creator = 'dkorchem'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 22048
    keywords = []
    message_count = 2.0
    messages = ['223746', '223749']
    nosy_count = 2.0
    nosy_names = ['mark.dickinson', 'dkorchem']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '18844'
    type = None
    url = 'https://bugs.python.org/issue22048'
    versions = ['Python 3.5']

    @dkorchem
    Copy link
    Mannequin Author

    dkorchem mannequin commented Jul 23, 2014

    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.

    @dkorchem dkorchem mannequin added the stdlib Python modules in the Lib dir label Jul 23, 2014
    @mdickinson
    Copy link
    Member

    mdickinson commented Jul 23, 2014

    Duplicate of bpo-18844.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant