1
2import numpy as np
3np.random.choice(values, size=1000, replace=True, p=probability)
4
5# values is the input values that correspond to the weights
6# size is the number of samples to generate
7# Replace specifies if it's with or without replacement
8# p is the probability of choosing each corresponding value in values
9