sampling¶
boltzmann_sampling¶
boltzmann_sampling(numbers, k=1, with_replacement=False)
Return k numbers from a boltzmann-sampling over the supplied numbers
-
numbers:List or np.ndarraynumbers to sample
-
k:intDefault: 1
How many numbers to sample. Choosing
k=Nonewill yield a single number -
with_replacement:BooleanDefault: FalseAllow replacement or not
Returns: list, np.ndarray or a single number (depending on the input)
weighted_sampling¶
weighted_sampling(numbers, k=1, with_replacement=False)
Return k numbers from a weighted-sampling over the supplied numbers
-
numbers:List or np.ndarraynumbers to sample
-
k:intDefault: 1
How many numbers to sample. Choosing
k=Nonewill yield a single number -
with_replacement:BooleanDefault: False
Allow replacement or not
Returns: list, np.ndarray or a single number (depending on the input)