I have a binary list that contains 0's and 1's. How do I get the count of consecutive 0's and 1's in another list? e.g , if X= [1,1,1,1,0,0,1,1,1,0,0]. I should get [4,2,3,2] as the output. Thanks.
I have a binary list that contains 0's and 1's. How do I get the count of consecutive 0's and 1's in another list? e.g , if X= [1,1,1,1,0,0,1,1,1,0,0]. I should get [4,2,3,2] as the output. Thanks.