title: Match Column name stored in another dataframe and replace by its ID
body: <p>I have a master data frame called Master, which contains all the ids of questions.
  I have multiple datasets containing those questions as header I want to replace those headers with their id's.</p>
  <p><strong>The Master table looks like this:</strong></p>
  <pre><code>Question               ID
  
  gender                 1
  sex                    1
  what is your gender    1
  sexual orientation     1
  marital status         2
  occupation             3
  whats you job          3
  </code></pre>
  <p><strong>df1 looks like this:</strong></p>
  <pre><code>gender         marital status  occupation
  
  Male           Single          Doctor
  Male           Divorced        Engineer
  </code></pre>
  <p>Desired output</p>
  <pre><code>   1            2                 3                 
  
     Male        Single            Doctor
     Male        Divorced          Engineer
  </code></pre>
  <p>also if any new variable comes in df1 which doesn't have id mentioned in the Master data table, a new ID should be given to it and variable name and id will be updated in <strong>master table</strong></p>
  <p>for eg.</p>
  <p><strong>df2 looks like this:</strong></p>
  <pre><code>gender         marital status  country
  
  Male           Single          India
  Male           Divorced        UK
  </code></pre>
  <p><strong>desired df2 :</strong></p>
  <pre><code>1                 2              4
  
  Male           Single          India
  Male           Divorced        UK
  </code></pre>
  <p><strong>updated master table will be:</strong></p>
  <pre><code>Question               ID
  
  gender                 1
  sex                    1
  what is your gender    1
  sexual orientation     1
  marital status         2
  occupation             3
  whats you job          3
  country                4
  </code></pre>