I have a dataset
|category| cat a cat b cat a
I\'d like to be able to return something like (showing unique values and frequency)
If your DataFrame has values with the same type, you can also set return_counts=True in numpy.unique().
return_counts=True
index, counts = np.unique(df.values,return_counts=True)
np.bincount() could be faster if your values are integers.