Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- from sqlalchemy import creat_engine
- df='alunos.csv'
- df.columns=[c.lower() for c in df.columns]
- print("alguns campos\n----")
- print pd.read(df,nrows=5)
- table=create_engine('postgresql://postgres:9104m4th3u5@localhost:5432/escola ')
- df.to_sql("alunos",table)
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- ~
- "importador_teste.py" 10L, 277C 6,17 Tudo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement