How to count unique values in a pandas DataFrame group in Python

PHOTO EMBED

Tue Dec 21 2021 07:16:30 GMT+0000 (Coordinated Universal Time)

Saved by [deleted user]

macro_df.groupby(CELL_NAME).agg({'Bandwidth':'count'})['Bandwidth'].unique()
content_copyCOPY

https://www.kite.com/python/answers/how-to-count-unique-values-in-a-pandas-dataframe-group-in-python