title: Create a Series from a Pandas DataFrame by choosing an element from different columns on each row
body: <p>My goal is to create a Series from a Pandas DataFrame by choosing an element from different columns on each row.</p>
  
  <p>For example, I have the following DataFrame:</p>
  
  <pre><code>In [171]: pred[:10]
  Out[171]: 
                       0  1  2
  Timestamp                   
  2010-12-21 00:00:00  0  0  1
  2010-12-20 00:00:00  1  1  1
  2010-12-17 00:00:00  1  1  1
  2010-12-16 00:00:00  0  0  1
  2010-12-15 00:00:00  1  1  1
  2010-12-14 00:00:00  1  1  1
  2010-12-13 00:00:00  0  0  1
  2010-12-10 00:00:00  1  1  1
  2010-12-09 00:00:00  1  1  1
  2010-12-08 00:00:00  0  0  1
  </code></pre>
  
  <p>And, I have the following series:</p>
  
  <pre><code>In [172]: useProb[:10]
  Out[172]: 
  Timestamp
  2010-12-21 00:00:00    1
  2010-12-20 00:00:00    2
  2010-12-17 00:00:00    1
  2010-12-16 00:00:00    2
  2010-12-15 00:00:00    2
  2010-12-14 00:00:00    2
  2010-12-13 00:00:00    0
  2010-12-10 00:00:00    2
  2010-12-09 00:00:00    2
  2010-12-08 00:00:00    0
  </code></pre>
  
  <p>I would like to create a new series, usePred, that takes the values from pred, based on the column information in useProb to return the following:</p>
  
  <pre><code>In [172]: usePred[:10]
  Out[172]: 
  Timestamp
  2010-12-21 00:00:00    0
  2010-12-20 00:00:00    1
  2010-12-17 00:00:00    1
  2010-12-16 00:00:00    1
  2010-12-15 00:00:00    1
  2010-12-14 00:00:00    1
  2010-12-13 00:00:00    0
  2010-12-10 00:00:00    1
  2010-12-09 00:00:00    1
  2010-12-08 00:00:00    0
  </code></pre>
  
  <p>This last step is where I fail.  I've tried things like:</p>
  
  <pre><code>usePred = pd.DataFrame(index = pred.index)
  for row in usePred:
      usePred['PREDS'].ix[row] = pred.ix[row, useProb[row]]
  </code></pre>
  
  <p>And, I've tried:</p>
  
  <pre><code>usePred['PREDS'] = pred.iloc[:,useProb]
  </code></pre>
  
  <p>I google'd and search on stackoverflow, for hours, but can't seem to solve the problem.</p>