My df looks like this
Date | Col | Col1 |
---|---|---|
01/01/2022 | A | 500 |
01/01/2022 | B | 100 |
01/01/2022 | C | 400 |
02/01/2022 | A | 400 |
02/01/2022 | B | 150 |
02/01/2022 | C | 450 |
My desired output looks like
Date | Total |
---|---|
01/01/2022 | 1000 |
02/01/2022 | 1000 |
Please help. I wanna do it automatically (not manually-hardcoded)
I am trying this
df.groupby('Date')['Col1'].sum()