title: Python: Creating list of subarrays
body: <p>I have a massive array but for illustration I am using an array of size 14. I have another list which contains 2, 3, 3, 6. How do I efficiently without for look create a list of new arrays such that:</p>
  
  <pre><code>import numpy as np
  A = np.array([1,2,4,5,7,1,2,4,5,7,2,8,12,3]) # array with 1 axis
  subArraysizes = np.array( 2, 3, 3, 6 ) #sums to number of elements in A
  B = list()
  B[0] = [1,2]
  B[1] = [4,5,7]
  B[2] = [1,2,4]
  B[3] = [5,7,2,8,12,3]
  </code></pre>
  
  <p>i.e. select first 2 elements from A store it in B, select next 3 elements of A store it in B and so on in the order it appears in A.</p>