count of unique values in column in pandas code example Example: pandas count unique values in column df.nunique()