print ('Files in Drive:')
!ls drive/AI`
驱动器中已经存在'database.sqlite'文件。 当我在Google Colab中运行上述代码时,驱动器中显然存在我的sqlite文件。但是每当我对此文件运行查询时,它都会显示
# using the SQLite Table to read data.
con = sqlite3.connect('database.sqlite')
#filtering only positive and negative reviews i.e.
# not taking into consideration those reviews with Score=3
filtered_data = pd.read_sql_query("SELECT * FROM Reviews WHERE Score !=3",con)
DatabaseError:在sql'SELECT * FROM Reviews WHERE Score!= 3'上执行失败:没有这样的表:Reviews
答案 0 :(得分:0)
上传文件后,点击左侧的导航窗格。在“文件”标签下,右键单击您上传的文件,然后选择“复制路径”。在连接中使用以下复制路径:
con = sqlite3.connect('content/database.sqlite')