how to count the number of unique values appeared in python code example
Example 1: counting unique values python
df.loc[df['mID']=='A','hID'].agg(['nunique','count','size'])
Example 2: python count unique values in list
len(set(["word1", "word1", "word2", "word3"]))
# set is like a list but it removes duplicates
# len counts the number of things inside the set