sample_from_range#
- sample_from_range(distr, min_val, max_val)[source]#
Sample from a distribution from min_val to max_val, inclusive.
- Parameters:
distr (dict) – distribution with integer keys
min_val (int) – minimum of the range to sample from
max_val (int) – maximum of the range to sample from
- Returns:
A sampled number from the range min_val to max_val in the distribution distr.