1import pandas as pd
2
3colors = {'color': ['green', 'blue', 'blue', 'red', 'green']}
4df = pd.DataFrame.from_dict(colors)
5
6print(df['color'].unique())
1Series.value_counts(self, normalize=False, sort=True, ascending=False, bins=None, dropna=True)
1# Returns a new DataFrame containing the distinct rows in this DataFrame
2
3df.ditinct().count()
4# 2