Is there a way to calculate the (multiplier x value) for the 5 years after a True, for each fruit? Shown the formulae here for clarity
df
fruit year value Criteria multiplier multiplier x value
apple 1950 2
apple 1951 3
apple 1952 3
apple 1953 4
apple 1954 5
apple 1955 4 True 1.4 (=1.4*4)
apple 1956 7 (=1.4*7)
..
apple 2000 8 (=1.4*8)
banana 1950 333
banana 1951 335