MCPcopy Create free account
hub / github.com/ipython/ipython / most_common

Function most_common

docs/autogen_shortcuts.py:25–31  ·  view source on GitHub ↗

Most common elements occurring more then `n` times

(lst, n=3)

Source from the content-addressed store, hash-verified

23
24
25def most_common(lst, n=3):
26 """Most common elements occurring more then `n` times
27 """
28 from collections import Counter
29
30 c = Counter(lst)
31 return [k for (k, v) in c.items() if k and v > n]
32
33
34def multi_filter_str(flt):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected