In [4]: df.groupby(['col1', 'col2']).size().reset_index(name='counts') Out[4]: col1 col2 counts 0 A B 4 1 C D 3 2 E F 2 3 G H 1