group by unique values pandas code example
Example 1: pandas unique values in column
#List unique values in the df['name'] column
df.name.unique()
Example 2: pandas groupby count unique rows
df = df.groupby(by='domain', as_index=False).agg({'ID': pd.Series.nunique})
print(df)
domain ID
0 fb 1
1 ggl 1
2 twitter 2
3 vk 3