title: Joining two pandas dataframes based on multiple conditions
body: <p><code>df_a</code> and <code>df_b</code> are two dataframes that looks like following</p>
  
  <pre><code>df_a
  A   B       C      D     E
  x1  Apple   0.3   0.9    0.6
  x1  Orange  0.1   0.5    0.2
  x2  Apple   0.2   0.2    0.1
  x2  Orange  0.3   0.4    0.9
  x2  Mango   0.1   0.2    0.3
  x3  Orange  0.3   0.1    0.2
  
  
  df_b
  A   B_new   F    
  x1  Apple   0.3  
  x1  Mango   0.2  
  x1  Orange  0.1   
  x2  Apple   0.2   
  x2  Orange  0.3     
  x2  Mango   0.1  
  x3  Orange  0.3  
  x3  Mango   0.2  
  x3  Apple   0.1  
  </code></pre>
  
  <p>I want my <code>final_df</code> to contain all the rows contained in <code>df_a</code> such that it contemplates the unique combination of <code>df_a['A'] == df_b['A']</code> and <code>df_a['B'] == df_b['B_new']</code>.</p>
  
  <p>I've tried doing outer join and then drop duplicates w.r.t columns A and B in <code>final_df</code> but the value of B_new is not retained. </p>
  
  <p>Following is how I want my <code>result_df</code> to look like:</p>
  
  <p>result_df</p>
  
  <pre><code> A   B       C      D     E   B_new  F
  x1  Apple   0.3   0.9    0.6  Apple  0.3
  x1  Orange  0.1   0.5    0.2  Orange 0.1
  x2  Apple   0.2   0.2    0.1  Apple   0.2 
  x2  Orange  0.3   0.4    0.9  Orange  0.3
  x2  Mango   0.1   0.2    0.3  Mango   0.1
  x3  Orange  0.3   0.1    0.2  Orange  0.3
  </code></pre>
  
  <p>I also tried left outer join:</p>
  
  <pre><code>final_df = pd.merge(df_a, df_b, how="left", on=['A'])
  </code></pre>
  
  <p>The size of this dataframe is a union of <code>df_a</code> and <code>df_b</code> which is not what I want. </p>
  
  <p>Appreciate any suggestions. </p>