Answers for "use pandas to read from sqlite"

SQL
2

convert sqlite table to pandas dataframe

import sqlite3
import pandas as pd

dat = sqlite3.connect('data.db')
query = dat.execute("SELECT * From <TABLENAME>")
cols = [column[0] for column in query.description]
results= pd.DataFrame.from_records(data = query.fetchall(), columns = cols)
Posted by: Guest on September-03-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language