As an example, my code is follows
df = df.groupby('a').agg({'b': 'nunique', 'c': 'nunique', 'd': 'sum'}).reset_index()
I am trying to count the distinct number of entries of column b and column c, which are both text columns. Using nunique does not work so I essentially need to replace nunique.