title: Variable shift in Pandas
body: <p>having two columns A and B in a dataframe: </p>
  
  <pre><code>   A   B
  0  1   6
  1  2   7
  2  1   8
  3  2   9
  4  1  10
  </code></pre>
  
  <p>I would like to create a column C. C must have values of B shifted by value of A:</p>
  
  <pre><code>   A   B   C 
  0  1   6 NaN
  1  2   7 NaN
  2  1   8   7
  3  2   9   7
  4  1  10   9
  </code></pre>
  
  <p>The command:</p>
  
  <pre><code>df['C'] = df['B'].shift(df['A'])
  </code></pre>
  
  <p>does not work. 
  Do you have any other ideas?</p>