title: Pandas - merge two dataframes, sum similar columns, only keep rows with matching keys (inner join)
body: <p>I'm stuck between pandas <code>concat</code> and <code>merge</code> function, struggling to get the best of both. I need to inner-join the rows on name and date, summing common columns A and B, and keep the value from category (really I could add this to the join if needed, they match).</p>
  
  <p>Example-</p>
  
  <p>df1</p>
  
  <pre><code>| name | date     | A | B | category |
  |------|----------|---|---|----------|
  | W    | 1/1/2020 | 1 | 1 | home     |
  | W    | 1/2/2020 | 1 | 1 | home     |
  | Y    | 1/3/2020 | 1 | 1 | garden   |
  | Y    | 1/4/2020 | 1 | 1 | garden   |
  </code></pre>
  
  <p>df2</p>
  
  <pre><code>| name | date     | A | B | category |
  |------|----------|---|---|----------|
  | W    | 1/1/2020 | 2 | 2 | home     |
  | W    | 1/2/2020 | 1 | 1 | home     |
  | Y    | 1/3/2020 | 1 | 1 | garden   |
  | Y    | 1/5/2020 | 1 | 1 | garden   |
  </code></pre>
  
  <p>desired result -</p>
  
  <pre><code>| name | date     | A | B | category |
  |------|----------|---|---|----------|
  | W    | 1/1/2020 | 3 | 3 | home     |
  | W    | 1/2/2020 | 2 | 2 | home     |
  | Y    | 1/3/2020 | 2 | 2 | garden   |
  </code></pre>
  
  <p>I've found that <code>merge</code> will join the rows, but duplicates any columns not joined on instead of summing them.</p>
  
  <p><code>concat</code> will sum the rows, but doesn't do an inner join so I get rows with data from just one dataframe or the other. I've tried <code>pd.concat([df_1, df_2], join='inner'</code>, but the "inner" doesn't do what I want.</p>