mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
merge
This commit is contained in:
commit
46cf02d25a
1 changed files with 3 additions and 3 deletions
|
@ -268,9 +268,9 @@ For example::
|
||||||
.. method:: most_common([n])
|
.. method:: most_common([n])
|
||||||
|
|
||||||
Return a list of the *n* most common elements and their counts from the
|
Return a list of the *n* most common elements and their counts from the
|
||||||
most common to the least. If *n* is not specified, :func:`most_common`
|
most common to the least. If *n* is omitted or ``None``,
|
||||||
returns *all* elements in the counter. Elements with equal counts are
|
:func:`most_common` returns *all* elements in the counter. Elements
|
||||||
ordered arbitrarily:
|
with equal counts are ordered arbitrarily:
|
||||||
|
|
||||||
>>> Counter('abracadabra').most_common(3)
|
>>> Counter('abracadabra').most_common(3)
|
||||||
[('a', 5), ('r', 2), ('b', 2)]
|
[('a', 5), ('r', 2), ('b', 2)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue