pandas df count distinct code example
Example 1: count unique pandas
df.nunique()
Example 2: pandas count distinct values in a column
Series.value_counts(self, normalize=False, sort=True, ascending=False, bins=None, dropna=True)
df.nunique()
Series.value_counts(self, normalize=False, sort=True, ascending=False, bins=None, dropna=True)