title: Python: pandas: match row value to column name/ key's value
body: <p><strong>Problem</strong><br>
  "How to match a row value to a column name and take that intersecting value in pandas" <br><br></p>
  
  <p><strong>Context</strong><br>
  We have a pandas df like this:</p>
  
  <pre><code>df = pd.DataFrame([{'name': 'john', 'john': 1, 'mac': 10}, {'name': 'mac', 'john': 2, 'mac': 20}], columns=["name", "john", "mac"])
  </code></pre>
  
  <p>Looking like this:<br></p>
  
  <pre><code>name | john | mac
  john |  1   | 10
  mac  |  2   | 20
  </code></pre>
  
  <p><br>
  <strong>Desired output</strong></p>
  
  <pre><code>name | john | mac  | value
  john |  1   | 10   | 1
  mac  |  2   | 20   | 20
  </code></pre>
  
  <p>In words, the column <code>"value"</code> should take the number from the corresponding column where name intersects. </p>
  
  <p>So, if <code>name == 'john'</code>,  then take the value from column 'john'<br>
  So, if <code>name == 'mac'</code>, then take the value from column 'mac'<br></p>
  
  <p><strong>Tried so far</strong><br>
  Bunch of lambdas (none successful). <br></p>
  
  <p><strong>Specifications</strong><br>
  Python: 3.5.2<br>
  Pandas: 0.18.1 </p>