Counting Objects Using Python's Counter

preview_player
Показать описание
Counting several repeated objects at once is a common problem in programming. Python offers a bunch of tools and techniques you can use to approach this problem. However, Python’s Counter from collections provides a clean, efficient, and Pythonic solution.

This dictionary subclass provides efficient counting capabilities out of the box. Understanding Counter and how to use it efficiently is a convenient skill to have as a Python developer.

This is a portion of the complete course, which you can find here:

The rest of the course covers how to:

- Use Counter in several practical examples
- Use additional methods like .most_common and .items
- Implement Counter instances as multisets
Рекомендации по теме
Комментарии
Автор

Thanks a lot for such informative video.

ChandraShekhar-bycd
Автор

I really appreciate the humor in the video... :-D (although I don't get the cat joke... :-p)

hiankun