Note
This documents the development version of NetworkX. Documentation for the current release can be found here.
weighted_choice
Returns a single element from a weighted sample.
The input is a dictionary of items with weights as values.