vendredi 23 juin 2017

In python, is there has another way could be recommend for randomly creating a random list with specified boundary?

So far, I use following codes for generating a random list with specified boundary:

def initGen(low,upp):
    ini=[]
    for i in range(len(low)):
        ini.append(random.uniform(low[i],upp[i]))

return ini

May somebody suggest a more compact or alternative way to achieve it? Many thanks in advance!!!




Aucun commentaire:

Enregistrer un commentaire