count unique the values in a column pandas code example Example 1: count unique pandas df['column'].nunique() Example 2: pandas count unique values in column df.nunique()