Answers for "How to count unique values in Python according to different id"

4

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
Posted by: Guest on June-04-2020
0

counting unique values python

df.loc[df['mID']=='A','hID'].agg(['nunique','count','size'])
Posted by: Guest on October-02-2020

Code answers related to "How to count unique values in Python according to different id"

Python Answers by Framework

Browse Popular Code Answers by Language