I have a DataFrame like this :
A B
1 foo 1.0
2 foo 0.2
3 foo 1.0
4 cat 1
5 bar 0.2
6 bar 0.2
7 bar 1
8 cat 1
I would like to know how to sum my B field according to the value of A.
I would like to have an output that looks like this:
A B
foo 2.2
cat 2.0
bar 1.4