Created
July 4, 2017 01:29
-
-
Save jhconning/9e0b6cf4900a46e4400d3ee6c3b517b9 to your computer and use it in GitHub Desktop.
read SQL into pandas with pymysql
This file contains 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 pymysql | |
mysql_connection = pymysql.connect(host='localhost', | |
user='root', | |
password='', | |
db='tutorfall2016', | |
charset='utf8', | |
cursorclass=pymysql.cursors.DictCursor) | |
sql = "SELECT * FROM `sign_ins`" | |
pd.read_sql(sql, mysql_connection, index_col='id') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment