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