count number of distinct values in a column pandas code example
Example 1: how to count number of unique values in a column python
pd.value_counts(df.Account_Type)
Gold 3
Platinum 1
Name: Account_Type, dtype: int64
Example 2: pandas count distinct values in a column
Series.value_counts(self, normalize=False, sort=True, ascending=False, bins=None, dropna=True)