I have a datafarme let's say something like this:
| ColumnX |
| -------------- |
| Hi |
| + Open |
| How are you |
| NAN |
| Something |
| something |
| HEY |
| + Open |
now I need to go through the rows checking their values. If the row value is "+ Open" then select the previous row value and put it into a list. so far this is what I've done but I couldn't figure out how to take the previous value-
ilist=[]
for i in df["ColumnX"]:
if i == '+ Open':
ilist.append(i)