frequency unique pandas code example Example 1: frequency unique pandas df.stack().value_counts() Example 2: count_values in python idx.value_counts()