Generating random numbers as the value of dictionary in python
<p>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:</p>

<pre><code>   df['Rand'] = random.sample(random.random(), 100)
</code></pre>

<p>But I don't know how to do that for a dictionary.</p>

<p>I think what you want is something like:</p>

<pre><code>{k: random.random() for k in range(100)}
</code></pre>

python dictionary random