I've got two fairly large dataframes of mismatched sizes (and times) of the following structure(s):
df1:
Date Value
2018-04-02 1.8
2018-04-03 1.82
2018-04-04 1.84
2018-04-05 1.75
2018-04-06 1.9
df2:
Date Value
2018-01-01 1.3
2018-01-02 1.3
2018-01-04 1.4
2018-01-05 1.6
What I'd like to do is combine those dataframes together, assuming that the value for missing values is the value closest to the missing date. So for example, the missing value for df1 on 2018-01-01 would be 1.8, while the missing value for df2 on 2018-04-03 would be 1.3. Once the dataframes are combined, I'd like to create a column that minuses the value of df2 on the day from df1.
Does anyone know how to do this? Any assistance greatly appreciated.