I have a dataframe as below, when i apply lambda it works fine but when i shift one value i am getting an error. I badly dont want to loop DF so wanted to shift value
def test(a,b,c):
return a+b+c
**this works fine**
df['value'] = df.apply(lambda x: test(x['basic_ub'],x['basic_lb'],x['atr']), axis = 1)
**when i shift, it give me error**
df['value'] = df.apply(lambda x: test(x['basic_ub'],x['basic_lb'],x['atr'].shift()), axis = 1)
'numpy.float64' object has no attribute 'shift
'