title: Pandas: vertical look up using two columns and two data frames
body: <p>Given the following dataframes:</p>
  
  <p>df1:</p>
  
  <pre><code>    ID  A           B           
  0   0   138.610513  34.860445   
  2   2   139.307536  34.919052       
  </code></pre>
  
  <p>df2:</p>
  
  <pre><code>    ID  A           B           CAT 
  0   0   138.610513  34.860445   a
  1   1   138.523152  34.807862   b
  2   2   139.307536  34.919052   c
  3   3   138.620263  34.883671   b
  </code></pre>
  
  <p>How can I look up the values in <code>CAT</code> and add them to <code>df1</code> as a new column?</p>
  
  <p>I have tried this:</p>
  
  <pre><code>df1['CAT']=df1[['A'],['B']].map(df2[['A'],['B']])
  </code></pre>
  
  <p>But I get:</p>
  
  <pre><code>TypeError: unhashable type: 'list'
  </code></pre>
  
  <p>Expected output:</p>
  
  <p>df1:</p>
  
  <pre><code>    ID  A           B           CAT 
  0   0   138.610513  34.860445   a
  2   2   139.307536  34.919052   c 
  </code></pre>
  
  <p>This is just a test case. In my real problem, I cannot use the IDs as a reference because they are not consistent.</p>