Here is my first dataframe df1
,
Open High Low Close
Date
2018-07-16 2797.360107 2801.189941 2793.389893 2798.429932
2018-07-17 2789.340088 2814.189941 2789.239990 2809.550049
2018-07-18 2811.350098 2816.760010 2805.889893 2815.620117
2018-07-19 2809.370117 2812.050049 2799.770020 2804.489990
2018-07-20 2804.550049 2809.699951 2800.010010 2801.830078
Now i want to add 21 July which is in another dataframe df2
for eg.,
Date Prediction
0 2018-07-25 2111.111
Now how should I add 2018-07-21
as df1
index and data corresponding to it should be df2['Prediction']
for Close
column else other column can be 0.
So final df should be like this,
Open High Low Close
Date
2018-07-16 2797.360107 2801.189941 2793.389893 2798.429932
2018-07-17 2789.340088 2814.189941 2789.239990 2809.550049
2018-07-18 2811.350098 2816.760010 2805.889893 2815.620117
2018-07-19 2809.370117 2812.050049 2799.770020 2804.489990
2018-07-20 2804.550049 2809.699951 2800.010010 2801.830078
2018-07-21 0 0 0 2111.111