011

edit ✏️

Load data from database into pandas

import pandas as pd
from sqlalchemy import create engine

engine = create_engine('postgresql://scott:[email protected]:5432/mydatabase')

sql = 'select * from inventory'

with engine.connect() as connection:
    inventory = pd.read_sql(sql, con)
engine.dispose()