Answers for "count unique pandas groupby"

8

count unique pandas

df['column'].nunique()
Posted by: Guest on March-12-2020
1

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
Posted by: Guest on October-25-2020

Code answers related to "count unique pandas groupby"

Python Answers by Framework

Browse Popular Code Answers by Language