Answers for "do a count of unique values in a dataframe columns with group by in python"

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
0

how to count unique values in a column dataframe in python

dataframe.column.nunique()
Posted by: Guest on May-30-2020

Code answers related to "do a count of unique values in a dataframe columns with group by in python"

Python Answers by Framework

Browse Popular Code Answers by Language