title: How can I get the random samples from a very large collection in Python efficiently
body: <p>I am trying to sample numbers which can be used as the annual income for a particular dataset.
  I have the following code which explodes in memory and the system hangs</p>
  
  <p><code>np.random.choice(xrange(750000, 1000000000), size=254)</code></p>
  
  <p>Then I changed the code to 
  <code>np.random.choice(xrange(75, 100000), size=254) * 10000</code></p>
  
  <p>the code works fine with less memory but.
  I am really not sure if affects the sampling from the distribution.</p>
  
  <p>Can I do it any efficient manner.</p>