Pandas Conditionally Combine (and sum) Rows
<p>Given the following data frame:</p>

<pre><code>import pandas as pd
df=pd.DataFrame({'A':['A','A','A','B','B','B'],
                'B':[1,1,2,1,1,1],
                'C':[2,4,6,3,5,7]})
df

    A   B   C
0   A   1   2
1   A   1   4
2   A   2   6
3   B   1   3
4   B   1   5
5   B   1   7
</code></pre>

<p>Wherever there are duplicate rows per columns 'A' and 'B', I'd like to combine those rows and sum the value under column 'C' like this:</p>

<pre><code>    A   B   C
0   A   1   6
2   A   2   6
3   B   1   15
</code></pre>

<p>So far, I can at least identify the duplicates like this:</p>

<pre><code>df['Dup']=df.duplicated(['A','B'],keep=False)
</code></pre>

<p>Thanks in advance!</p>