Guest User

Untitled

a guest
Jul 27th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import pandas as pd
  2. import pyodbc
  3. conn = pyodbc.connect('DSN=NZDWW')
  4. df2 = pd.read_sql(Query,conn)
  5.  
  6. from sqlalchemy import create_engine
  7. username = os.getenv('REDSHIFT_USER')
  8. password = os.getenv('REDSHIFT_PASS')
  9. DATABASE = "SHP_TARGET"
  10. HOST = "Netezza1"
  11. PORT = 5480
  12. conn_str = "postgresql://"+username+":"+password+"@"+HOST+':'+str(PORT)+'/'+DATABASE
  13. engine3 = create_engine(conn_str)
  14. df = pd.read_sql(Query, engine3)
Add Comment
Please, Sign In to add comment