Skip to content

Instantly share code, notes, and snippets.

@dapangmao
Created August 18, 2015 16:26
Show Gist options
  • Save dapangmao/decc66bc7642a6063a63 to your computer and use it in GitHub Desktop.
Save dapangmao/decc66bc7642a6063a63 to your computer and use it in GitHub Desktop.

A link

import pandas as pd
df = pd.read_csv('mypath.csv')
df.columns = [c.lower() for c in df.columns]

from sqlalchemy import create_engine
engine = create_engine('postgresql://username:password@localhost:5432/dbname')

df.to_sql("fhrs", engine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment