title: Pandas: control new column names when merging two dataframes?
body: <p>I would like to merge two Pandas dataframes together and control the names of the new column values. </p>
  
  <p>I originally created the dataframes from CSV files. The original CSV files looked like this:</p>
  
  <pre><code>   # presents.csv
     org,name,items,spend...
     12A,Clerkenwell,151,435,...
     12B,Liverpool Street,37,212,...
     ...
     # trees.csv
     org,name,items,spend...
     12A,Clerkenwell,0,0,...
     12B,Liverpool Street,2,92,...
     ...
  </code></pre>
  
  <p>Now I have two data frames:</p>
  
  <pre><code>df_presents = pd.read_csv(StringIO(presents_txt))
  df_trees = pd.read_csv(StringIO(trees_txt))
  </code></pre>
  
  <p>I want to merge them together to get a final data frame, joining on the <code>org</code> and <code>name</code> values, and then prefixing all other columns with an appropriate prefix. </p>
  
  <pre><code>org,name,presents_items,presents_spend,trees_items,trees_spend...
  12A,Clerkenwell,151,435,0,0,...
  12B,Liverpool Street,37,212,2,92,...
  </code></pre>
  
  <p>I've been reading the documentation on <a href="http://pandas.pydata.org/pandas-docs/stable/merging.html" rel="noreferrer">merging and joining</a>. This seems to merge correctly and result in the right number of columns:</p>
  
  <pre><code>ad = pd.DataFrame.merge(df_presents, df_trees,
                          on=['practice', 'name'],
                          how='outer')
  </code></pre>
  
  <p>But then doing <code>print list(aggregate_data.columns.values)</code> shows me the following columns:</p>
  
  <pre><code>[org', u'name', u'spend_x', u'spend_y', u'items_x', u'items_y'...]
  </code></pre>
  
  <p>How can I rename <code>spend_x</code> to be <code>presents_spend</code>, etc?</p>