There is my data after comparing two dataframes:
frames = [9,12,14,15,16,17,18,22,23,24,25,30]
df1 = [75,75,75,75,75,75,75,75,75,75,75,75]
df2 = [*[0]*len(df1)]
d = {'frames':frames,'a':df1, 'b':df2}
df = pd.DataFrame(d)
I need to count consecutive frames, count starts after two consecutive values:
counter = [0,0,0,0,1,1,1,0,0,1,1,0]
df['c'] = counter
result = counter.count(1)
I can't figure it out, maybe there is a way to do it with pandas? Thanks!