Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import collections
- c1 = collections.Counter(['a', 'b', 'c', 'a', 'b', 'b'])
- c2 = collections.Counter('alphabet')
- print 'C1:', c1
- print 'C2:', c2
- print '\nCombined counts:'
- print c1 - c2
- print '\nIntersection (taking positive minimums):'
- print c1 & c2
- print '\nUnion (taking maximums):'
- print c1 | c2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement