Home > Software engineering >  how do i find the city & country with the highest number of unique customers, also the count of uniq
how do i find the city & country with the highest number of unique customers, also the count of uniq

Time:10-22

[![dataset][1]][2]

how to find the country with highest number of unique customers?

CodePudding user response:

can you try:

df=df.groupby('COUNTRY')['IDCUSTOMER'].nunique()

#or if you want to group by country and city

df=df.groupby(['COUNTRY','CITY'[)['IDCUSTOMER'].nunique()
  • Related