Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #sqlite #table #pandas #dataframe
ADD COMMENT
Topic
Name
1+1 =