title: Reshape jagged array and fill with zeros
body: <p>The task I wish to accomplish is the following: Consider a <em>1-D</em> array <code>a</code> and an array of indices <code>parts</code> of length <code>N</code>. Example:</p>
  <pre><code>a = np.arange(9)
  parts = np.array([4, 6, 9])
  
  # a = array([0, 1, 2, 3, 4, 5, 6, 7, 8])
  </code></pre>
  <p>I want to cast <code>a</code> into a <em>2-D</em> array of shape <code>(N, &lt;length of longest partition in parts&gt;)</code>, inserting values of <code>a</code> upto each index in <code>indx</code> in each row of the <em>2-D</em> array, filling the remaining part of the row with zeroes, like so:</p>
  <pre><code>array([[0, 1, 2, 3],
         [4, 5, 0, 0],
         [6, 7, 8, 0])
  </code></pre>
  <p>I do not wish to use loops. Can't wrap my head around this, any help is appreciated.</p>