title: sum from array until a given value is reached.
body: <p>I have several numpy arrays with values, that look as follows:</p>
  
  <pre><code>po_freq1 = [0.01408451 0.05633803 0.14084507 0.02816901 0.01408451 0.01408451
  0.05633803 0.05633803 0.01408451 0.01408451 0.01408451 0.01408451
  0.02816901 0.07042254 0.01408451 0.01408451 0.04225352 0.11267606
  0.04225352 0.01408451 0.04225352 0.02816901 0.01408451 0.04225352
  0.05633803 0.01408451 0.01408451 0.01408451]
  </code></pre>
  
  <p>my goal is to chose randomly some values from my array and sum these values until a given value for example 0.90 is reached.  Does anyone have an idea? </p>