I have a pandas dataframe column that looks as follows:
col1
200
300
400
200
500
700
0
0
60
0
0
I'm trying to create a new column that is determined based on the current row value but taking into account the next few row values also. So e.g. if (row_col1(i) > 60) & ((row_col1(i+1)+row_col1(i+2)+row_col1(i+3)) > 100), write 'yes' in col2.
col1 col2
200 yes
300 yes
400 yes
200 yes
500 yes
700 yes
0 no
0 no
60 no
0 no
0 no
Any ideas on how to achieve this?