I haven't be able to find this anywhere. I want to be able to create a column that uses the data from the column before the column that contains "end".
I may not even be explaining that well.
For Example:
df =
V1 V2 V3 V4 V5 V6
0 start 1 end ended 0
3 end 0 start 5 0
2 start 3 next 6 end
I want the new column to be the number before the following column says "end".
V1 V2 V3 V4 V5 V6 end_num
0 start 1 end ended 0 1
3 end 0 start 5 0 3
2 start 3 next 6 end 6