title: Merge, sum and removing duplicates with pandas
body: <p>I have two different data frames with different sizes just like this:</p>
  
  <pre><code>df_web = (['Event Category', 'ID', 'Total Events', 
             'Unique Events', 'Event Value', 'Avg. Value'])
  
  df_app = (['Event Category', 'ID', 'Total Events',
             'Unique Events', 'Event Value', 'Avg. Value']
  </code></pre>
  
  <p>I'm using pandas to try to merge them in a 'df_final', but I want to sum the values of 'Total Events' which have the same 'ID' , and in the end I would like to have a 'df_final' without duplicates in the ID.</p>
  
  <p>I tried: </p>
  
  <pre><code>df_final_analysis = df_web.groupby(['Event Category', 'ID', 'Total Events', 
                                     'Unique Events', 'Event Value', 'Avg. Value'],
                                      as_index=False)['Total Events'].sum()
  </code></pre>
  
  <p>But it doesnt give me the result that I want. </p>
  
  <p>For example:</p>
  
  <p>df_web</p>
  
  <pre><code>  Video          A        10
  
    Video          B         5
  
    Video          C         1
  
    Video          F         1
  
    Video          G         1
  
    Video          H         1
  </code></pre>
  
  <p>For df_app:</p>
  
  <pre><code>  Video         A       15
  
  
    Video         D        3
  
  
    Video         C        1
  </code></pre>
  
  <p>For the df_final_analysis I want:</p>
  
  <pre><code>  Video         A       25
  
    Video         B        5
  
    Video         D        3
  
    Video         C        2
  
    Video         F        1
  
    Video         G        1
  
    Video         H        1
  </code></pre>
  
  <p>Is there a elegant way to do this?</p>