title: Randomly picking numbers from a list according to a uniform distribution
body: <p>I have a list as such</p>
  
  <pre><code>a = [.5,.57,.67,.8,1,1.33,2,4]
  </code></pre>
  
  <p>Which looks like this when plotted:
  <a href="https://i.stack.imgur.com/razLH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/razLH.png" alt="enter image description here"></a></p>
  
  <p>I need to randomly pick a number in this list. In Python, I would normally go like this:</p>
  
  <pre><code>c = random.choice(a)
  </code></pre>
  
  <p>Except... Doing this biases the pick towards a lower value (the density is higher around 1 than it is around 4).</p>
  
  <p>How would I go about picking a list entry according to a uniform distribution. As in c = random.random()*3.5+.5, but actually picking from the list?</p>