'Summarising 2 columns

So I'm not sure if I'll be explaining this question well, but As you can see in one columns there are counties and the other one is the number of herds and what I wanna do is the find out how many herds are in each country rather than counting how many times the county appears and than adding them all together. I hope it makes sense. If someone can share some function on how to do that, that would be wonderful, thank you!

df_image



Solution 1:[1]

df.groupby('COUNTY')['NUMBER_OF_HERDS'].sum()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rabinzel