I wonder whether there is the fastest code to replace the two for loops, assuming the df size is very large. In my real case, each dataframe is 200 rows and 25 columns.
I also figured out that below code does what I want and is much faster than two for loops.
df1.loc[[1,2,5],[1,3]] = df2.loc[[1,2,3],[1,2]].values