I have two data frames:
df1 = pd.DataFrame({'dateRep': ['2020-09-10', '2020-08-10', '2020-07-10',
'2020-24-03', '2020-23-03', '2020-22-03'],
'cases': [271, 321, 137,
8, 0, 1],
'countriesAndTerritories': ['Kenya', 'Kenya','Kenya',
'Uganda', 'Uganda', 'Uganda']})
df1
and
df2 = pd.DataFrame({'date': ['2020-15-02', '2020-16-02', '2020-17-02',
'2020-08-10', '2020-07-10', '2020-06-10'],
'cases': [2.0, 0.0, 5.0,
-3.7, -5.0, 0.0],
'country_refion': ['Kenya', 'Kenya','Kenya',
'Uganda', 'Uganda', 'Uganda']})
df2
which I want to combine or merge by date into one data frame:
df3 = pd.DataFrame({'date': ['2020-15-02', '2020-16-02', '2020-17-02',
'2020-22-03', '2020-23-03', '2020-24-03',
'2020-06-10', '2020-07-10', '2020-07-10', '2020-08-10', '2020-08-10', '2020-09-10'],
'cases': [2.0, 0.0, 5.0,
1.0, 0.0, 8.0,
0.0, -5.0, 137, -3.7, 321, 271],
'country_refion': ['Kenya', 'Kenya','Kenya',
'Uganda', 'Uganda', 'Uganda',
'Uganda', 'Uganda', 'Kenya', 'Uganda', 'Kenya', 'Kenya']})
df3
I tried the .join(), and .concatenate() methods, which didn't work as expected. Thank you for your help in advance!