for i in range(1, len(df.index)):
    new.append(new[i - 1] * df.A.values[i] + df.B.values[i])
df['C'] = new
Is there a way in Pandas to use previous row value in dataframe.apply when previous value is also calculated in the apply?