finding most common elements between thousands of multiple arrays.

Scott David Daniels Scott.Daniels at Acm.Org
Fri Jul 10 16:38:06 EDT 2009


Raymond Hettinger wrote:
> [Scott David Daniels]
>> def most_frequent(arr, N): ...
> In Py2.4 and later, see heapq.nlargest().
I should have remembered this one

> In Py3.1, see collections.Counter(data).most_common(n)
This one is from Py3.2, I think.


--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list