title: Merging two Pandas DataFrames with identical columns as well as different ones
body: <p>I have two Dataframes which I want to merge on the column CCOL: I am giving a short sample as follows: ( the same name Cols have the same data in both dataframes)</p>
  <pre><code> df1 = 
  
      CCOL     ColA    ColB   ColC   ColD     ColE     ColF
  
       A        1.0     a      b      23       45       2.7
       B        3.0     c      q      26       34       5.9
       C        5.0     f      r      2        4.9      15.9
       D        7.0     e      s      45       2         8
  
  
   df2 = 
  
      CCOL     ColA    ColB   ColE   ColP    ColR     ColS
  
        A      1.0     a       45     vq      4       21.7
        AF     7.0     za     7.9     r       4       3.1
        D      7.0     e       2      gh      3       53.1
        GK     8.0     ut     2       qt      4      33.3
  </code></pre>
  <p>So the final output from these two dataframes I am looking for is like:</p>
  <pre><code>  final_df = 
      
      CCOL  ColA ColB ColC ColD ColE ColF ColP ColR ColS
      
       A     1.0   a    b    23   45   2.7  vq   4   21.7
       D     7.0   e    s    45   2     8   gh   3   53.1
  </code></pre>
  <p>I tried</p>
  <pre><code>    newdf = pd.merge(df1,df2,on='CCOL', how='inner')
  </code></pre>
  <p>However, this one creates ColA_x, ColA_y etc in the new df from same columns, which I do not need.</p>
  <p>My tries:,</p>
  <pre><code>   newdf = df1.combine_first(df2)
  </code></pre>
  <p>However, this one creates a dataframe like the follows which gives correct data for rows with CCOL, &quot;A&quot; &amp; &quot;D&quot; but totally wrong for the columns which df1 &amp; df2 does not match on CCOL.</p>
  <pre><code>     newdf = 
        
        CCOL  ColA ColB ColC ColD ColE ColF ColP ColR ColS
         A    1.0    a    b   23  45.0  2.7   vq  4.0 21.7
         B    3.0    c    q   26  34.0  5.9    r  4.0 3.1
         C    5.0    f    r   2   4.9   15.9  gh  3.0 53.1
         D    7.0    e    s   45  2.0   8.0   qt  4.0 33.3
  </code></pre>
  <p>So not understanding how to achieve my output final_df. Any help will be very much appreciated.</p>