Is there a way to see how many items in a dictionary share the same value in Python?
Let\'s say that I have a dictionary like:
{\"a\": 600, \"b\": 75
You could use itertools.groupby for this.
import itertools x = {"a": 600, "b": 75, "c": 75, "d": 90} [(k, len(list(v))) for k, v in itertools.groupby(sorted(x.values()))]