import numpy as np # %% Params of choice(): sample_space = np.array([1, 2, 3, 4, 5, 6]) sample_size = 2 replace = True prob = [1/6, 1/6, 1/6, 1/6, 1/6, 1/6] # %% Generating random sample: sample = np.random.choice(sample_space, sample_size, replace, prob) print('sample =', sample)