NetworkX

Previous topic

zipf_rv

Next topic

weighted_choice

random_weighted_sample

static random_sequence.random_weighted_sample(mapping, k)

Return k items without replacement from a weighted sample.

The input is a dictionary of items with weights as values.