Created
April 13, 2014 17:30
-
-
Save chrishowes/10593783 to your computer and use it in GitHub Desktop.
MySQL to Pandas DataFrame
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 MySQLdb | |
db_conn = MySQLdb.connect(host="HOST", user="USER", passwd="PW", db="DATABASE") | |
sql_str = "SELECT field FROM table" | |
df = pdb.io.sql.read_frame(sql_str, db_conn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment