numpy count unique values code example
Example 1: np array value count
unique_elements, counts_elements = np.unique(a, return_counts=True)
Example 2: 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 3: count unique values pandas
df['hID'].nunique()
5
Example 4: counting unique values python
df.loc[df['mID']=='A','hID'].agg(['nunique','count','size'])