title: Pandas adding rows to df in loop
body: <p>I'm parsing data in a loop and once it's parsed and structured I would like to then add it to a data frame.</p>
  
  <p>The end format of the data frame I would like is something like the following:</p>
  
  <pre><code>df:
  
  id   2018-01 2018-02 2018-03  
  234     2       1       3
  345     4       5       1
  534     5       3       4
  234     2       2       3
  </code></pre>
  
  <p>When I iterate through the data in the loop I have a dictionary with the id, the month and the value for the month, for example:</p>
  
  <pre><code>{'id':234,'2018-01':2}
  {'id':534,'2018-01':5}
  {'id':534,'2018-03':4}
             .
             .
             .
  </code></pre>
  
  <p>What is the best way to take an empty data frame and add rows and columns with their values to it in a loop?</p>
  
  <p>Essentially as I iterate it would look something like this </p>
  
  <pre><code>df:
  
  id   2018-01   
  234     2       
  </code></pre>
  
  <p>then</p>
  
  <pre><code>df:
  
  id   2018-01   
  234     2  
  534     5
  </code></pre>
  
  <p>then</p>
  
  <pre><code>df:
  
  id   2018-01   2018-03
  234     2  
  534     5         4
  </code></pre>
  
  <p>and so on...</p>