Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 4th, 2013  |  syntax: None  |  size: 0.19 KB  |  views: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import pyodbc
  2.  
  3. import pandas.io.sql as psql
  4.  
  5. cnxn = pyodbc.connect(your_connection_info)
  6. cursor = cnxn.cursor()
  7. sql = ("""SELECT * FROM Source""")
  8.  
  9. df = psql.frame_query(sql, cnxn)
  10. cnxn.close()
clone this paste RAW Paste Data