Sep-29-2020, 02:45 PM
Hi:
I am not able to get the update statement to work :( - any help on what I'm missing ?
I am not able to get the update statement to work :( - any help on what I'm missing ?
c.execute("select DISTINCT Symbol from StockData") tickers = c.fetchall() for row in tickers: c.execute("select [Adj Close] from StockData where Symbol = ? ", (row)) AdjClose = c.fetchall() df_ta = pd.DataFrame(data = AdjClose, dtype=numpy.float64) df_ta = df_ta.apply(lambda c: talib.RSI(c, timeperiod = 14)) for index, item in df_ta.iterrows(): try: c.execute('''UPDATE StockData SET RSI = ? where Symbol = ? ''', (item.values, row)) except Exception as e: print('Update Error: ' + str(e)) print('Updated' + str(row)) conn.commit() print ("Number of rows updated: {}".format(c.rowcount))Error -- Update Error: Error binding parameter 1 - probably unsupported type.