title: Matlab to Python conversion of rand()
body: <p>In Matlab I have the following:</p>
  
  <pre><code>duration = 20
  n=5
  times = rand(1,n)*duration;
  </code></pre>
  
  <p>The variable "times" gives a 1-by-n matrix, which is populated with random numbers between 0 and 1, then multiplied by 20. This will result in a set of 5 numbers between 0 and 20. </p>
  
  <p>Now I want to achieve the same in Python, what would be the equivalent? 
  I tried the following:</p>
  
  <pre><code>times = random.uniform(1,durations,n)  %% or times = random.uniform(1,20,5)
  </code></pre>
  
  <p>But I get this error: </p>
  
  <blockquote>
    <p>TypeError: uniform() takes exactly 3 arguments (4 given)</p>
  </blockquote>
  
  <p>which does not make sense to me, because I only seem to have given it 3 arguments.</p>