unique elements in a dataframe column and their counts python code example
Example 1: count unique pandas
df['column'].nunique()
Example 2: values of unique from dataframe with count
data = df.groupby('ColumnName')['IDColumnName'].nunique()
print(data)