python list unique values count code example Example: counting unique values python df.loc[df['mID']=='A','hID'].agg(['nunique','count','size'])