title: count numbers associated with category in list
body: <p>I have a list like this</p>
  
  <pre><code>GroupID,Number
  yellow,1
  yellow,2
  tan,0
  blue,1
  black,2
  black,3
  </code></pre>
  
  <p>What I want is this </p>
  
  <pre><code>GroupID,Number
  yellow,3
  tan, 0
  blue,1
  black,5
  </code></pre>
  
  <p>So I want to add the numbers associated with each groupID. </p>
  
  <p>This is what I got, but have difficulty with the result statement:</p>
  
  <pre><code>from collections import defaultdict
  d = defaultdict(list)
  f = open("metal_modules.csv","r")
  sheet = f.readlines()
  #print sheet
  for line in sheet[1:]:
  #print line
  spl = line.strip().split(",")
  #print spl[1]
  name = spl[0]
  d[name].append(spl[1])
  
  outfile = open("out.txt","w")
  result = ""
  for v in d.values():
       result = #here I need to sum the number in column two for each key in    the dictionary#
  #print result
  outfile.write(result)
  f.close()
  outfile.close()
  </code></pre>