lundi 17 octobre 2016

Generating random numbers as the value of dictionary in python

Could you please tell me how can I generate a dictionary with 100 rows that have random number between 0 and 1 in each row as the value? For example in data frame, I can have:

   df['Rand'] = random.sample(random.random(), 100)

But I don't know how to do that for a dictionary.




Aucun commentaire:

Enregistrer un commentaire