title: repeat arange with numpy
body: <p>I have an array with integer values.</p>
  
  <pre><code>a = [2,1,4,0,2]
  </code></pre>
  
  <p>I want a apply arange function to each value in a so as to have : </p>
  
  <pre><code>b = [0,1,0,0,1,2,3,1,2]
  b "=" [arange(2),arange(1),arange(4),arange(0),arange(2)] 
  </code></pre>
  
  <p>In fact I use a np.repeat function to repeat array rows according to array a, and I want to have a mark of i to linked each repeated value to the original one and to have an identification number to then distinguish them.</p>
  
  <p>I tried with np.vectorize but with no success.</p>