import numpy as np # %% Params of choice(): sample_space = np.array([1, 2, 3, 4, 5, 6]) sample_size = 5 replace = True prob = [1/6, 1/6, 1/6, 1/6, 1/6, 1/6] # %% Definition of fixed seed of random generator: my_random_seed = np.random.RandomState(seed=1) # %% Generating sample with choice(): samples = my_random_seed.choice( sample_space, sample_size, replace, prob) print('Samples =', samples)