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