Created
March 20, 2020 20:04
-
-
Save aniruddha27/871847694f45e613b497c325066b26f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import sqlite3 | |
# open engine connection | |
con=sqlite3.connect('./Importing files/sample_test.db') | |
# create a cursor object | |
cur = con.cursor() | |
# Perform query: rs | |
rs = cur.execute('select * from TEST') | |
# Save results of the query to DataFrame: df | |
df = pd.DataFrame(rs.fetchall()) | |
# Close connection | |
con.commit() | |
# Print head of DataFrame df | |
df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment