title: Python - Update dictionary int values by adding from another dictionary Counter()
body: <pre><code>origincount = {
          'Bug': 0,
          'Important': 0,
          'User Story': 0,
          'Critical': 0,
          'Moderate': 0,
          'Low': 0,
          'story': 0
      }
      if epic['archived'] is False:
          for story in stories:
              if story['epic'] is not None and story['epic']['id'] == epic['id']:
                  counts = Counter(label['name'] for label in story['labels'])
                  origincount.update(counts)
  </code></pre>
  
  <p>I'm having trouble understanding dictionary updates when the values need to be increased together not just "updated".</p>
  
  <p>From the example above when the origincount.update(counts) occurs , it simply changes the value to whatever it is in counts. on the next look it does the same thing. </p>
  
  <p>The problem is I need to increase the value by the counts not just replace it.</p>
  
  <p>I tried looping through counts and doing an if against it being not 0, then adding doing origincount['Bug'] = counts['Bug'] + origincount['Bug']. but that seemed to fail due to my own errors or just not at all.</p>
  
  <p>Update:</p>
  
  <pre><code>for epic in epics:
      origin = Counter({
          'Bug': 0,
          'Important': 0,
          'User Story': 0,
          'Critical': 0,
          'Moderate': 0,
          'Low': 0,
          'story': 0
      })
  
      if epic['archived'] is False:
          for story in stories:
              if story['epic'] is not None and story['epic']['id'] == epic['id']:
                  # story_total += 1
                  counts = Counter(label['name'] for label in story['labels'])
                  print(counts)
                  origin = origin + counts
  
  print(origin)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Counter({'Bug': 1, 'Important': 1})
  Counter({'Critical': 1, 'Bug': 1})
  Counter({'User Story': 1})
  Counter({'Bug': 1})
  Counter({'Bug': 1, 'Important': 1})
  Counter({'Bug': 1, 'Important': 1})
  Counter({'Critical': 1, 'Bug': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'Critical': 1, 'Bug': 1})
  Counter({'Critical': 1, 'Bug': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'User Story': 1})
  Counter({'Critical': 1, 'Bug': 1})
  Counter({'Critical': 0, 'User Story': 0, 'Important': 0, 'story': 0, 'Low': 0, 'Bug': 0, 'Moderate': 0})
  </code></pre>
  
  <p>Even with counter conversion of the origin dict it still doesn't add them up.</p>