Skip to content

wsample(w) behaves not as the documentation describes it #884

Open
@cafaxo

Description

@cafaxo

The doc says

wsample([rng], [a], w)

Select a weighted random sample of size 1 from a with probabilities
proportional to the weights given in w. If a is not present, select a random
weight from w.

From this, I expect wsample(w) ∈ w. However, I am getting

julia> wsample([1,10])
2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions