title: pandas merge dataframes on certain columns but exclude them in the result dataframe
body: <p>In <code>pandas</code>, I have to include certain columns that I want to merge two <code>dataframe</code>s on, </p>
  
  <pre><code>result = df_a.merge(df_b[['A', 'B', 'C']], how='left', on=['A', 'B'])
  </code></pre>
  
  <p>so if I want to merge <code>df_a</code> and <code>df_b</code> on columns <code>A</code> and <code>B</code>, I have to also include <code>A</code> and <code>B</code> in the <code>result</code> <code>dataframe</code>, but what I really want is only column <code>C</code>. I am wondering if there a way to only include <code>C</code> in <code>merge</code>.</p>
  
  <p>A sample result dataframe after merge,</p>
  
  <pre><code>year_x    code_x    year_y    code_y    id
  2000      005       2000.00   005       1
  2001      006       2001.00   006       2
  2002      007       2002.00   007       3
  </code></pre>
  
  <p><code>df_a</code> and <code>df_b</code> all contain <code>year</code> and <code>code</code>, I only need <code>id</code> from <code>df_b</code>, but I have to <code>merge</code> on <code>code</code> and <code>year</code>.</p>
  
  <p>originally <code>year</code> is of <code>int64</code> dtype in both <code>df_a</code> and <code>df_b</code>, but after the merge <code>year_y</code> turned into <code>float</code>, which is also confusing. </p>
  
  <p>If I <code>drop</code> <code>code_y</code> and <code>year_y</code> after the <code>merge</code>, I may have to <code>rename</code> <code>code_x</code> and <code>year_x</code> back to <code>code</code> and <code>year</code>, which is not convenient if I can eliminate the duplicate columns in the first place.    </p>