df2['date'] = df1['date'].values
df2['hour'] = df1['hour'].values
It’s better use inter join
case.tail(3) caseCA caseON caseDaily CAcaseDailyON case_Date_province 2020-04-26 47864 15411 1598.0 498.0 2020-04-27 49499 15868 1635.0 457.0 2020-04-28 50982 16337 1483.0 469.0
test.tail(3) testCA testON testDailyCA testDailyON date_testing 2020-04-26 734824 229638 23570.0 12020.0 2020-04-27 765056 242188 30232.0 12550.0 2020-04-28 787612 253040 22556.0 10852.0
case_test = pd.concat([case, test], axis=1, join='inner')
case_test.tail(5) caseCA caseON caseDailyCA caseDailyON testCA testON testDailyCA testDailyON ratioCA ratioON ratioDailyCA ratioDailyON 2020-04-26 47864 15411 1598.0 498.0 734824 229638 23570.0 12020.0 6.513669 6.710997 6.779805 4.143095 2020-04-27 49499 15868 1635.0 457.0 765056 242188 30232.0 12550.0 6.469984 6.551935 5.408177 3.641434 2020-04-28 50982 16337 1483.0 469.0 787612 253040 22556.0 10852.0 6.472984 6.456291 6.574747 4.321784