I have a data frame like this:
index value
---- -----
1 A
2 A
3 A
4 A
5 B
6 B
7 A
8 B
9 C
10 C
I want to add a column to count continues occurrence of my value, like this:
index value continues-count
---- ----- ----------
1 A 1
2 A 2
3 A 3
4 A 4
5 B 1
6 B 2
7 A 1
8 B 1
9 C 1
10 C 2
I am able to do it using a loop but as my dataset is huge it takes forever!