I have a DataFrame df
:
date cases country
0 2020-12-14 63 AF
1 2020-12-13 71 AF
2 2020-12-12 110 AF
3 2020-12-11 91 AF
...
501 2020-12-14 14 BE
502 2020-12-13 22 BE
503 2020-12-12 19 BE
504 2020-12-11 35 BE
...
I also have a Series casesPerDay
:
date
2019-12-31 0
2020-01-01 0
2020-01-02 46
2020-02-03 58
...
I want to add casesPerDay
to df
so that the date
column in df
matches the date
index in casesPerDay
.
For example if there were only the 2 countries above it would look like this:
date cases country casePerDay # just the sum of cases
0 2020-12-14 63 AF 77 # 63 + 14
1 2020-12-13 71 AF 93 # 71 + 22
2 2020-12-12 110 AF 129 # 110 + 19
3 2020-12-11 91 AF 126 # 91 + 35
...
501 2020-12-14 14 BE 77 # 63 + 14
502 2020-12-13 22 BE 93 # 71 + 22
503 2020-12-12 19 BE 129 # 110 + 19
504 2020-12-11 35 BE 126 # 91 + 35
...