title: Match values in the row of a dataframe to a column in a reference dataframe, and change value
body: <p>I have a dataframe (d1) with respondents answers to a series of questions (Q1-Q12), such that the questions are the column names and a respondents answers are 1 row across all the columns, the next respondents answers are row 2 across the columns. 
  Another dataframe (d2) has a questions column with Q1-Q12 as the rows and a Correct_answers column with the correct answers to questions Q1-Q12</p>
  
  <p>My question is how to compare the respondents answers in d1 with the correct answers in d2, changing the values in d1 to 1 if the respondent answered correctly and 0 if the respondent answered incorrectly.</p>
  
  <p>Thanks</p>