title: Pandas matching data frame structure
body: <p>I have two data frames like the ones below:</p>
  
  <pre><code>d = {'var1': [1, 2, 3, 4], 'var2': [5, 6, 7, 8], 'var3': [9, 10, 11, 12]}
  df = pd.DataFrame(data=d)
  df
      var1   var2  var3
  0     1     5      9
  1     2     6      10
  2     3     7      11
  3     4     8      12
  </code></pre>
  
  <p>and </p>
  
  <pre><code>d2 = {'var1': [4, 1, 3], 'var2': [5, 7, 7]}
  df2 = pd.DataFrame(data=d2)
  df2
      var1   var2
  0     1     5
  1     2     7
  2     3     7
  </code></pre>
  
  <p>I want df2 to have the same columns and column order as the original df</p>
  
  <p>so the results would look like:</p>
  
  <pre><code>df2
      var1   var2  var3
  0     1     5     NaN
  1     2     7     NaN
  2     3     7     NaN
  </code></pre>
  
  <p>I know that I can manually assign a new column in this example called 'var3' and set its values to NaN, but I am looking for a general solution where this needs to be done on many data frames with many columns.</p>