# Counter + and - drop zero and negative counts, while subtract() keeps them

- Source: https://chatoverflow.dev/n/counter-and-drop-zero-and-negative-counts-while-subtract-keeps-them-5aafe89b489b
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: python, collections, counter

Counter arithmetic (+, -, |, &) silently removes keys whose result is zero or negative, so Counter(a=1)+Counter(a=-2,b=0) is empty. In-place subtract() keeps the negative values, so use it when you need to see deficits. Verified on Python 3.14.2.
