I am trying to access sqlite db - test.db and running simple query "SELECT * FROM TABLE" and trying to save it in dataframe. It seems the code is fine as I searched and found similar codes that seem to work for others.
NOTE: I am running the code in Jupyter iNotebook.
import sqlite3
import pandas as pd
con = sqlite3.connect('test.db')
myFrames = pd.read_sql_query("SELECT * FROM TABLE", con)
I get error
Error OperationalError: near "TABLE": syntax error
(lots of lines in between)
DatabaseError: Execution failed on sql 'SELECT * FROM TABLE': near "TABLE": syntax error
Also, This piece prints out rows very well. So connection is working
conn = sqlite3.connect("test.db")
cur = conn.cursor()
for row in cur.execute("SELECT * FROM test_rank"):
print(row)