Numpy Uniform Distribution With Decay
<p>I'm trying to construct a matrix of uniform distributions decaying to 0 at the same rate in each row. The distributions should be between -1 and 1. What I'm looking at is to construct something that resembles:</p>

<pre><code>[[0.454/exp(0) -0.032/exp(1) 0.641/exp(2)...]
 [-0.234/exp(0) 0.921/exp(1) 0.049/exp(2)...]
 ...
 [0.910/exp(0) 0.003/exp(1) -0.908/exp(2)...]]
</code></pre>

<p>I can build a matrix of uniform distributions using:</p>

<pre><code>w = np.array([np.random.uniform(-1, 1, 10) for i in range(10)])
</code></pre>

<p>and can achieve the desired result using a <code>for</code> loop with:</p>

<pre><code>for k in range(len(w)):
    for l in range(len(w[0])):
        w[k][l] = w[k][l]/np.exp(l)
</code></pre>

<p>but wanted to know if there was a better way of accomplishing this. </p>