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