I have a dataframe:
df = C1 C2 E
1 2 3
4 9 1
3 1 1
8 2 8
8 1 2
I want to add another columns that will have the count of the value that is in the columns 'E' in all the dataframe (in the column E) So here the output will be:
df = C1. C2. E. cou
1. 2. 3. 1
4. 9. 1. 2
3. 1. 1 2
8. 2. 8. 1
8. 1. 2. 1 #2 appears only one it the column E
How can it be done efficiently ?