frequency of categorical variable in python code example Example: frequency unique pandas df.stack().value_counts()