title: Concatenating selected columns from two data frames in python pandas
body: <p>I am trying to concatenate some of the columns in my data frame in python pandas. Say, I have the following data frames:</p>
  <blockquote>
  <p>df1['Head','Body','feat1','feat2']</p>
  <p>df2['Head','Body','feat3','feat4']</p>
  </blockquote>
  <p>I want to merge the dataframes into:</p>
  <blockquote>
  <p>merged_df['Head','Body','feat1','feat2','feat3',feat4']</p>
  </blockquote>
  <p>Intuitively, I did this:</p>
  <pre><code>merged_df = pd.concat([df1, df2['feat3','feat4'],axis=1)
  </code></pre>
  <p>It did not work. I did my research and did this:</p>
  <pre><code>merged_df = 
  df1[['Head','Body','feat1','feat2']].merge(df2[['Head','feat3','feat4']], 
  on='Head', how='left')
  </code></pre>
  <p>It worked but caused some discrepancies on my data. Turns out some of my 'Head' data are not unique. So now I am just looking for the most straight forward way to concatenate the selected columns from DF2 into my DF1. Note that both data frames follow the same order, so the row 1 in DF1 is directly related to row 1 in DF2, so is the row 8120th and so on..</p>
  <p>Thanks</p>