how to count unique values in pandas code example Example 1: count unique pandas df['column'].nunique() Example 2: count unique values pandas df['hID'].nunique() 5