title: Creating an Array of Uniformly Distributed RVs with changing ranges based on values in another column
body: <p>I have two numpy arrays current_index which I am trying to fill, and time_to_maturity which has various times. I want to fill current_index uniformly with varying boundaries.</p>
  <p>I see two ways to do this, do you know why both works. The first one makes sense to me:</p>
  <pre><code>for i in range(len(current_index)):
  current_index[i] =  np.random.uniform(low=900.0*(1 - .2 *((756 - time_to_maturity[i])/252)), high=1000*(1 + .2 *((756 - time_to_maturity[i])/252)))
  </code></pre>
  <p>I know this is not the ideal way, and I want to vectorize this operation. I tried something else which seemed to work but I do not know why.</p>
  <pre><code>current_index =  np.random.uniform(low=900*(1 - .2 *((756 - time_to_maturity)/252)), high=1000**(1 + .2 *((756 - time_to_maturity)/252)))
  </code></pre>
  <p>Why does the second way work? I am setting the whole array to a single value with the upper and lower bounds as the whole array? I did not specify the output shape, so I am curious as to why this works.</p>
  <p>Thank you in advanced.</p>