Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #61910
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | collections Counter most_common method |
| Date | 2013-12-14 18:54 +0000 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4121.1387047279.18130.python-list@python.org> (permalink) |
This method returns a list, the example from The Fine Docs being:-
>>> Counter('abracadabra').most_common(3)
[('a', 5), ('r', 2), ('b', 2)]
With the trend in Python being more and more towards methods returning
iterators, is there ever likely to be an imost_common method, or has
this been suggested and rejected, or what? I'm really just curious, but
if enough people were to express an interest and it hasn't already been
done, I'd happily raise an enhancement request on the bug tracker.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
collections Counter most_common method Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-14 18:54 +0000 Re: collections Counter most_common method Roy Smith <roy@panix.com> - 2013-12-14 14:37 -0500
csiph-web