Generating random numbers as the value of dictionary in python
dictionary, python, random
Solution
I think what you want is something like:
{k: random.random() for k in range(100)}
Problem
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.