How to open a file.sql not pandas?
I intend to make a dataframe of a database that I imported from pgadmin4 as a 'vialactea' file.sql ' when I try to run pandas command in jupyter only from error message.
The bank is saved in the same folder as the notebook file, which facilitates access to it.
vialactea = pandas.read_sql('vialactea.sql')
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-8-376ba7310a4f> in <module>
----> 1 vialactea = pandas.read_sql('vialactea.sql')
NameError: read_sql() missing 1 required positional argument: 'con'
0
Author: Erison Eduard, 2020-02-20
1 answers
import sqlite3
conn = sqlite3.connect('teste.db')
cursor = conn.cursor()
# inserindo dados na tabela
cursor.execute("select * from banco")
0
Author: Guilherme Alves, 2020-02-20 20:50:27