Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> We can return the smallest value from the **table** instead
> of the code below.

Internally, that does too much work and then throws most of it away.

The difference between Counter(data).most_common()[1] and 
Counter(data).most_common(1) is that the former materializes the entire items 
iterator into a list and does a full sort, while the latter is memory friendly 
and makes a single pass with min().

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35892>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to