Articles → PANDAS → Read_Sql Function In Pandas
Read_Sql Function In Pandas
Purpose
Installing Sqlalchemy
Example
import pandas as pd
from sqlalchemy import create_engine
engine = create_engine("sqlite:///c:\sqlite\SchoolDB.db")
engine.connect()
df = pd.DataFrame()
df = pd.read_sql('select * from Departments', con=engine)
print(df)
Output
Click to Enlarge