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