Número de pares únicos en columnas pandas
#df named df1 columns A and B
df1.groupby(['A','B']).size().reset_index().rename(columns={0:'count'})
Cruel Caterpillar
#df named df1 columns A and B
df1.groupby(['A','B']).size().reset_index().rename(columns={0:'count'})