I need to somehow limit my array by sum of its elements. So, I suppose to do something like
l = [1, 3, 4, 5, 2, 7]
if sum(l) >= 10:
ans = [1, 3, 4, 0, 0, 0]
In general, I want to generate some trains, which have 5 or 10 minutes difference (p_i = 1/2)
a = np.random.choice([5, 10], (10**4, n)) -- like this.
But the sum of elements must be <= 600 and I have to use maximum of numpy abilities.