Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.utils.random_sequence.random_weighted_sample

random_weighted_sample(mapping, k, seed=None)[source]

Return k items without replacement from a weighted sample.

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