title: Take the mean values of a number of integers in one list, based on the integers in another list
body: <p>I have one list containing a large number of integers, and then another list also containing integers that (if added together) sums up to the total amount of integers in the first list. I wish to create a function which iterates over the second list, and for each number in the second list, takes the mean of the values in the first list and repeats for all integers in the second list...making one final third list containing the desired mean-values.</p>
  <p>For example: A small portion of my two lists look like this: <code>[20, 15, 20, 30, 40, 20, 10, 8]</code>, <code>[2, 3, 1, 2]</code></p>
  <p>So since 2 is the first number in my second list, I want to take the mean of the first two integers in my first list, and then the 3 next, and so on, and add these into a third list.</p>
  <p>Here is a brief idea of what I am thinking, but its obviously not complete.</p>
  <pre class="lang-py prettyprint-override"><code>def mean_values(list_of_numbers, numbers_for_meanvalue):
          list_of_means = []
          for i in numbers_for_meanvalue:
               mean = sum(list_of_numbers[0]+...+list_of_numbers[i])/numbers_for_meanvalue[i]
               list_of_means.append[mean]
          return list_of_means
  </code></pre>