I have data frame with repetition of IDs like
slNo | Id
-----|---
0 | 1
1 | 2
2 | 2
3 | 3
4 | 3
5 | 2
I would like to have a new column with the repetition count like this:
slNo | ID| count|
-----|-- |------|
0 | 1 | 1 |
1 | 2 | 1 |
2 | 2 | 2 |
3 | 3 | 1 |
4 | 3 | 2 |
5 | 2 | 3 |
can anybody please help?