I have a large data frame with first 2 columns as follows. I managed to group_count
but unable to get a column with total count. i.e 14
id company group_count
1 aaa 1
1 bbb 2
1 bbb 2
1 ccc 1
1 ddd 1
1 eee 2
1 eee 2
1 fff 3
1 fff 3
1 fff 3
1 ggg 1
1 hhh 1
1 iii 1
1 jjj 1
I am expecting the following
id company count total count
1 aaa 1 10
1 bbb 2 10
1 bbb 2 10
1 ccc 1 10
1 ddd 1 10
1 eee 2 10
1 eee 2 10
1 fff 3 10
1 fff 3 10
1 fff 3 10
1 ggg 1 10
1 hhh 1 10
1 iii 1 10
1 jjj 1 10