I have this dataframe:
data={'col1':[1,3,3,1,2,3,2,2]}
df=pd.DataFrame(data,columns=['col1'])
I want to loop through it, and do something if a row as the same value as the last row.
Something like this:
for row, index in df.iterrows():
if row == previous row: # that's the line I'm looking for
print("ok")