title: Merge two different dataframes on different column names
body: <p>I have two dataframes,</p>
  
  <pre><code>df1 = pd.DataFrame({'A': ['A1', 'A1', 'A2', 'A3'],
                       'B': ['121', '345', '123', '146'],
                       'C': ['K0', 'K1', 'K0', 'K1']})
  
  df2 = pd.DataFrame({'A': ['A1', 'A3'],
                        'BB': ['B0', 'B3'],
                        'CC': ['121', '345'],
                        'DD': ['D0', 'D1']})
  </code></pre>
  
  <p>Now I need to get the similiar rows from column A and B from df1 and column A and CC from df2.
  And so I tried possible merge options, such as:</p>
  
  <pre><code>both_DFS=pd.merge(df1,df2, how='left',left_on=['A','B'],right_on=['A','CC'])
  </code></pre>
  
  <p>and this will not give me row information from df2 dataframe which is what I needed. Meaning, I have all column names from df2 but the rows are just empty or Nan.</p>
  
  <p>And then I tried:</p>
  
  <pre><code>Both_DFs=pd.merge(df1,df2, how='left',left_on=['A','B'],right_on=['A','CC'])[['A','B','CC']]
  </code></pre>
  
  <p>And this give me error as,</p>
  
  <pre><code>KeyError: "['B'] not in index"
  </code></pre>
  
  <p>I am aiming to have a merged Dataframe with all columns from both df1 and df2. Any suggestions would be great</p>
  
  <p>Desired output:</p>
  
  <pre><code> Both_DFs
      A   B   C   BB  CC  DD
  0   A1  121 K0  B0  121 D0
  </code></pre>
  
  <p>So in my data frames (df1 and df2), only one row has exact match for both columns of interest. That is, Column A and B from df1 has only one row matching exactly to rows in columns A and CC in df2 </p>