I would like to find the value of the first occurrence after certain value in row.
Test dataframe:
df = pd.DataFrame({'part': ["Toyota", "basic", "upgraded", "Skoda", "basic", "upgraded", "VW", "basic", "upgraded"],
'id': ["", 1, 2, "", 4, 5, "", 6, 7]})
part id
0 Toyota
1 basic 1
2 upgraded 2
3 Skoda
4 basic 4
5 upgraded 5
6 VW
7 basic 6
8 upgraded 7
I am looking for the value in the "upgraded" row that is after "Skoda" - thus 5.
Any tips how to do this in Pandas dataframe?
Thank you.