On Aug 16, 2013 11:05 AM, "Steven D&apos;Aprano" <st...@pearwood.info>
wrote:
>
> I'll provide two functions: mode, which returns the single value with the
highest frequency, or raises; and a second function, which collates the
data into a sorted (value, frequency) list. Bike-shedding on the name of
this second function is welcomed :-)

I'd call it counts() and prefer an OrderedDict for easy lookup. By that
point you're very close to Counter though (which it currently uses
internally).

Oscar
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to