I'm trying to loop through a table that contains covid-19 data. My table has 4 columns: month, day, location, and cases. The values of each column in the table is stored in its own list, so each list has the same length. (Ie. there is a month list, day list, location list, and cases list). There are 12 months, with up to 31 days in a month. Cases are recorded for many locations around the world. I would like to figure out what day of the year had the most total combined global cases. I'm not sure how to structure my loops appropriately. An oversimplified sample version of the table represented by the lists is shown below.
In this small example, the result would be month 1, day 3 with 709 cases (257 + 452).
| Month | Day | Location | Cases |
|---|---|---|---|
| 1 | 1 | CAN | 124 |
| 1 | 1 | USA | 563 |
| 1 | 2 | CAN | 242 |
| 1 | 2 | USA | 156 |
| 1 | 3 | CAN | 257 |
| 1 | 3 | USA | 452 |
| . | . | ... | ... |
| 12 | 31 | ... | ... |