title: Pandas Merging on two columns
body: <p>I am new to pandas and want to merge two tables with the help of two columns. A row can only be identified with both columns in combination.</p>
  <pre><code>Example:
  Table 1.               Table2.  
  Index A B C D.         Index A B C 
   1.   a a c d.         1.    a b j
   2.   a b e f.         2.    a c k
   3.   a c g h
  
  
  Result:
  
  Table
  Index A B C D E
   1.   a a c d na
   2.   a b e f j
   3.   a c g h k
  
  
  I tried something like:
  
  df_new = df_1.merge(df_2, on=[‘A’,’B’]
  </code></pre>
  <p>But I got the error B is not unique</p>
  <p>(In the real case the table contain every value in a and b multiple times, but the combination is unique.)</p>
  <p>Many thanks in advance.</p>