MCPcopy Create free account
hub / github.com/ActiveState/code / histogram

Function histogram

recipes/Python/497011_Count_commits/recipe-497011.py:22–27  ·  view source on GitHub ↗
(seq)

Source from the content-addressed store, hash-verified

20 return [log["author"] for log in pysvn.Client().log(repos)]
21
22def histogram(seq):
23 result = {}
24 for x in seq:
25 result.setdefault(x, 0)
26 result[x] += 1
27 return result
28
29def format2cols(items):
30 max_width = max(len(str(x)) for (x,y) in items)

Callers 1

sort_uniq_cFunction · 0.70

Calls 1

setdefaultMethod · 0.45

Tested by

no test coverage detected