I need a help for a relatively simple calculation, but I keep failing to solve it.
Say I have the following data, where keeping the order is necessary:
X = [0,0,1,1,0,1,1,1,1,1,0,0]
and I want to know how many times '1' is repeated for 2x, and that two '1's is considered as 1 score. So score for X should be 3.
I have a relatively long data (1x74240) with 0, 1, and -1.
With the logic above, I need to know the score for when the data shows repeated 1 and repeated -1.
Any sort of input is appriciated.