Ignore the date column we just need to merge based on YYYY-MM .
First table has one rwo for each month but second table may have multiple rows for each month. First rows matching month’s data should be merged to all of them.
data-frame 1:
2020-01-01 1.480
2020-02-01 1.620
2020-03-01 1.000
2020-04-01 1.000
2020-05-01 1.950
2020-06-01 1.080
2020-07-01 1.480
2020-08-01 1.620
2020-09-01 1.000
2020-10-01 1.000
2020-11-01 1.950
2020-12-01 1.080
2021-01-01 11.480
2021-02-01 12.620
2021-03-01 13.000
2021-04-01 14.000
2021-05-01 15.950
2021-06-01 16.080
2021-07-01 17.480
2021-08-01 18.620
2021-09-01 19.000
2021-10-01 10.000
2021-11-01 11.950
2021-12-01 12.080
2022-01-01 21.480
2022-02-01 22.620
2022-03-01 23.000
2022-04-01 24.000
2022-05-01 25.950
2022-06-01 26.080
2022-07-01 27.480
2022-08-01 28.620
2022-09-01 29.000
2022-10-01 30.000
2022-11-01 31.950
2022-12-01 32.080
2023-01-01 31.480
2023-02-01 31.620
2023-03-01 32.000
2023-04-01 32.200
2023-05-01 31.950
2023-06-01 32.080
2023-07-01 33.080
data-frame 2:
2020-01-15 NaN NaN 111 111
2020-02-25 NaN 333 NaN 204
2021-02-22 123 NaN NaN 111
2023-07-18 NaN 324 111 NaN
2023-03-15 NaN NaN NaN 205
desired data-frame:
2020-01-15 1.480 NaN NaN 111 111
2020-02-25 1.620 NaN 333 NaN 204
2021-02-22 1.620 123 NaN NaN 111
2023-07-18 33.080 NaN 324 111 NaN
2023-03-15 32.000 NaN NaN NaN 205