Reputation: 239
Below The image is a demo dataset
The Desired Result is like this, what pandas functions should I use here
Please Read the headings in Image 2 to get a better understanding of my question
Upvotes: 0
Views: 52
Reputation: 10970
Use groupby with aggregation
df.groupby(['col1', 'col2']).agg({'col3': ['count', 'sum']})
Upvotes: 2