I have a dataframe like this (simplified example)
DF1
id q1 q2_1 q2_2
1 1 1 1
2 1 2 2
3 2 3 3
4 2 3 3
5 1 1 3
and a dataframe with corresponding values like this
DF2
var num val
q1 1 male
q1 2 female
q2 1 one
q2 2 two
q2 3 three
What I would like its to replace values in the df1 with corresponding values from df2 to get DF3
DF3
id q1 q2_1 q2_2
1 male one one
2 male two two
3 female three three
4 female three three
5 male one three