title: value index lengh
body: <p>I have a dataframe as follows:</p>
  
  <pre><code>      Col1
  0      A
  1      B
  3      D
  4      A
  5      A
  </code></pre>
  
  <p>I would like to create a column that calculates the difference of index between 2 occurences of same value. I would get:</p>
  
  <pre><code>      Col1      Col2
  0      A         0
  1      B         0
  3      D         0
  4      A         4
  5      A         1
  </code></pre>
  
  <p>for each value I would like to do that, in this example B and D occured once.</p>
  
  <p>Any suggestions ? thanks !</p>