Python · Lesson 10.2 · Pro
collections: Counter and defaultdict
Ready-made tools for the counting and grouping patterns you wrote by hand.
In this lesson
- Counter counts for you
- The most common values
- defaultdict fills in missing keys
- namedtuple: tuples with field names
Go Pro to read this lesson
Pro unlocks every lesson and practice problem in SQL, Python, pandas and NumPy, with answers and step-by-step explanations.