Pandas How to flag consecutive values ignoring the first occurrence
Pandas How to flag consecutive values ignoring the first occurrence Question: I have the following code: data={‘id’:[1,2,3,4,5,6,7,8,9,10,11], ‘value’:[1,0,1,0,1,1,1,0,0,1,0]} df=pd.DataFrame.from_dict(data) df Out[8]: id value 0 1 1 1 2 0 2 3 1 3 4 0 4 5 1 5 6 1 6 7 1 7 8 0 8 9 0 9 10 1 10 11 …