Reputation: 15
def draw_new_r(r_list):
delta_r = np.random.uniform(low = -0.1, high= 0.1, size =3)
return np.maximum(0,r_list+delta_r)
draw_new_r(np.array([0.2, 0.4, 0.8]))
it returns an array which is sorted like [0.23855333 0.36313398 0.86038547]
draw_new_r(np.array([0.39, 0.4, 0.8]))
it returns an array which is not sorted like [0.47735026, 0.46623568, 0.70666558] How can i edit this def function which always will return sorted values of the random function.
Upvotes: 0
Views: 41