SyntaxFix
Write A Post
Hire A Developer
Questions
You can just use the built-in function count follow by the groupby function
df.groupby(['col5','col2']).count()