python count number of categorical variables code example Example: frequency unique pandas df.stack().value_counts()