in eventdata/parameter_sources/weightedarray.py [0:0]
def histogram(self, item_list):
"""
Creates a histogram of the provided items.
:param item_list: A list of tuples (weight, data).
"""
h = {}
for w, _ in item_list:
if w not in h:
h[w] = 0
h[w] += 1
return h