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()

![][1]](https://img.codepudding.com/202210/9a01a3ff13aa42d885e33ea8c2a787c1.jpg)