Created
December 20, 2021 22:52
-
-
Save cetver/674e51f4d95374ebe09072e887f77823 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import collections | |
population = [1, 2, 3, 4] | |
weights = [0.5, 0.25, 0.15, 0.1] | |
samples = random.choices(population, weights, k=100) | |
print(collections.Counter(samples)) |
afonari
commented
Dec 20, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment