As long as your dataframe (df1) contains data for a single security your code should work. The rows of df1 should be days (or minutes if using minute data) and the columns should be the associated high, low, and close values.
atr = talib.ATR(df1['High'],df1['Low'],df1['Close'],timeperiod=20)
The Talib functions return a 1 dimensioned numpy array (ie a series). So, to get a single value (in this case the latest value) one can use simple python indexing of -1.
todayATR = atr[-1]
That may be your issue. Another issue may be that you are trying to use the Talib functions to get values for multiple securities at a time. No can do. The inputs must each be series (ie only data for one security).
See attached notebook.
Good luck.