title: Panda-Column as index for numpy array
body: <p>How can I use a panda row as index for a numpy array? Say I have</p>
  
  <pre><code>&gt;&gt;&gt; grid = arange(10,20)
  &gt;&gt;&gt; df = pd.DataFrame([0,1,1,5], columns=['i'])
  </code></pre>
  
  <p>I would like to do</p>
  
  <pre><code>&gt;&gt;&gt; df['j'] = grid[df['i']]
  IndexError: unsupported iterator index
  </code></pre>
  
  <p>What is a short and clean way to actually perform this operation?</p>
  
  <p><strong>Update</strong></p>
  
  <p>To be precise, I want an additional column that has the values that correspond to the indices that the first column contains: <code>df['j'][0] = grid[df['i'][0]]</code> in column <code>0</code> etc</p>
  
  <p>expected output:</p>
  
  <pre><code>index i j 
      0 0 10
      1 1 11
      2 1 11
      3 5 15 
  </code></pre>
  
  <p><strong>Parallel Case: Numpy-to-Numpy</strong></p>
  
  <p>Just to show where the idea comes from, in standard python / <code>numpy</code>, if you have</p>
  
  <pre><code>&gt;&gt;&gt; keys = [0, 1, 1, 5]
  &gt;&gt;&gt; grid = arange(10,20)
  &gt;&gt;&gt; grid[keys]
  Out[30]: array([10, 11, 11, 15])
  </code></pre>
  
  <p>Which is exactly what I want to do. Only that my keys are not stored in a vector, they are stored in a column.</p>