Python - pandas, group by and max count

Viewed 150

I need the most similar (max count) from column cluster-1 from column cluster-2.

Input - data

Input data

Output - data

output

I use the command: df.groupby(['cluster-1','cluster-2'])['cluster-2'].count() this command will give me count per occurrence in the column cluster-2. I need advice on how to proceed, thanks.

1 Answers
Related