Created
March 18, 2013 14:01
-
-
Save c0ldlimit/5187339 to your computer and use it in GitHub Desktop.
#python #pandas #sql Pyodbc query to dataframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/13570178/itter-from-some-odbc-connection-to-pandas-table-with-out-a-csv | |
import pyodbc | |
import pandas.io.sql as psql | |
cnxn = pyodbc.connect(your_connection_info) | |
cursor = cnxn.cursor() | |
sql = ("""SELECT * FROM Source""") | |
df = psql.frame_query(sql, cnxn) | |
cnxn.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment