0

I have a dataframe that shows the case ID, occurred date, average temperature on that day, and total murder counts on that date

Case ID Date Temp Date Murder Count
1 01/01/2001 18.3 2
2 01/01/2001 18.3 2
3 01/04/2001 26.0 2
4 01/04/2001 26.0 2
5 01/08/2001 18.3 1

I want to calculate the total murder count grouped by the daily average temperature, the table should look like something like this:

Temp Total Murder Count
18.3 3
26.0 2

How do I do this in python?

0 Answers0