title: How to append Python dictionary to Pandas DataFrame, matching the key to the column name
body: <p>I've looked through old questions and they solve similar problems but not the one I'm trying to figure out. As quick background, I'm ingesting an API that sometimes returns slightly different objects, but I'd like to append them all to the same table.</p>
  <p>If the value is not in one of the dictionaries I'd like for that to be left blank in the dataframe</p>
  <pre><code>df = pd.DataFrame(columns=['C1','C2','C3','C4'])
  
  r1 = {'C1':20,'C2':15,'C3':10,'C4':53}
  r2 = {'C1':47,'C3':26,'C4':17}
  r3 = {'C2':31,'C3':64,'C4':29}
  r4 = {'C1':64,'C2':17}
  r5 = {'C1':45,'C2':24,'C3':71,'C4':63}
  </code></pre>
  <p>How do I loop over r1-5 and append them to the DataFrame like this?</p>
  <pre><code> C1    C2    C3    C4
   20    15    10    53
   47   None   26    17
  None   31    64    26
   64    17   None  None
   45    24    71    63
  </code></pre>
  <p>Thanks in advance!</p>
  <p>EDIT: To add some additional information, here's something I've tried so far.</p>
  <p>I've turned each dictionary into a list of dictionaries and then tried to loop over each of those key:value pairs and use the Key in the Loc function</p>
  <p>As an example:</p>
  <pre><code>r1 = [{'C1':20},{'C2':15},{'C3':10},{'C4':53}]
  </code></pre>