table

table(x)

Frequency table of x, sorted by name, like R’s table(). Returns a dict of {value: count}.