Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Du Phan fehiepsi

🏠
Working from home
View GitHub Profile
@stefanthoss
stefanthoss / mysql-pandas-import.py
Last active Apr 20, 2020
Import data from a MySQL database table into a Pandas DataFrame using the pymysql package.
View mysql-pandas-import.py
mport pandas as pd
import pymysql
from sqlalchemy import create_engine
engine = create_engine("mysql+pymysql://USER:PASSWORD@HOST:PORT/DBNAME")
df = pd.read_sql_query("SELECT * FROM table", engine)
df.head()
You can’t perform that action at this time.