title: Record included for each document - processing CSV
body: <p>I have a large CSV file with the following structure:</p>
  
  <pre><code>doc_id, inclusion, id
   1, TRUE, 842
   1, FALSE, 768
   1, FALSE, 292
   1, FALSE, 393
   2, TRUE, 191
   2, TRUE, 389
   2, TRUE, 171
   ...
  </code></pre>
  
  <p>The <code>id</code> is the primary key. <code>doc_id</code> is a foreign and represents the document which each id is linked to. Many id's are linked to each document. Each <code>id</code> is classified as included (ie. <code>inclusion == True</code>) or excluded (ie. <code>inclusion == False</code>).</p>
  
  <p>I need to create a summary table which displays for each <code>doc_id</code>, the number of <code>id</code>'s included and excluded. I can do this for all <code>doc_id</code>'s but am not sure how to implement it for each <code>doc_id</code>. For example, for the data above I want:</p>
  
  <pre><code>doc_id included excluded
  1      1        3
  2      3        0
  ...
  </code></pre>
  
  <p>This is my current code:</p>
  
  <pre><code>for index, row in citationData.iterrows():
      if row.included == True:
          inc = inc + 1
      else:
          exc = exc + 1
  </code></pre>