Skip to content

Instantly share code, notes, and snippets.

View rahman9909's full-sized avatar
🧭
In search of right path

Muhammad Abdur Rahman rahman9909

🧭
In search of right path
View GitHub Profile
@rahman9909
rahman9909 / mysql-pandas-import.py
Created September 15, 2018 22:14 — forked from stefanthoss/mysql-pandas-import.py
Import data from a MySQL database table into a Pandas DataFrame using the pymysql package.
import 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()