The accepted answer of the most frequent occurrence is
a = np.array([1,2,3,1,2,1,1,1,3,2,2,1])
counts = np.bincount(a)
print(np.argmax(counts))
But I'm wondering if anybody has an elegant way of finding the top 10 most frequent, for example. Thanks