The nunique() function of Pandas returns the count of distinct elements in the specified axis. If you want to find the count of unique elements in each column, do not specify any axis in the function.
Here is an example:
>>> import pandas as pd>>> df = pd.DataFrame({'A':[1,2,3,4,3,2], 'B':[11,21,3,21,3,11]})>>> df A B0 1 111 2 212 3 33 4 214 3 35 2 11>>> df.nunique()A 4B 3dtype: int64