Lets say I have the following df
val 0 x 1 x 2 z 3 y 4 x 5 y 6 y 7 z 8 x 9 z
I would like to create a new column that keeps track