# talib.ATR or other ATR calculation

I have my data stored in df1 with the columns: Date Time Open High Low Close Vol OI I want to calculate the 20 period ATR from my df1. Using TA-Lib I have tried the following which gives an error:

todayATR = talib.ATR(df1['High'],df1['Low'],df1['Close'],timeperiod=20)


I am new to python so I might have missed something simple.

talib functions do not accept pandas time series as inputs. Try
talib.ATR(df1['High'].values, df1['Low'].values, df1['Close'].values, timeperiod=20)