vendredi 27 novembre 2020

How do i create random weights within a range that add up to 1 in python

How do i create an array of random numbers that a) add up to 1 and b) are subject to upper and lower bounds? For example, assume the upper and lower bounds are 0.1 and 0.5 and i want to create an array of three random floats x1, x2 and x3 that add up to 1. thx in advance!




Aucun commentaire:

Enregistrer un commentaire