0

I have a dataset, df, where I would like to groupby a specific column and sum.

Type     

A
A
A
B
B
C

Desired

Type        Count
 
 A           3
 B           2
 C           1

Doing:

df.groupby(['Type']).sum()

However this is the output I am getting when I use the above:

A
B
C

Any suggestion is appreciated. Thank you

Lynn
  • 4,292
  • 5
  • 21
  • 44

0 Answers0