# import the library - if you are getting an error install pyodbc from terminal using the line below # pip install pyodbc --proxy="httpproxy.munich.munichre.com:3128" import pyodbc import pandas as pd # create a connection with SQL server you may need to change the driver if you are getting an erro , conn = pyodbc.connect('DRIVER={SQL Server};SERVER=wtk-crouch;DATABASE=Ladder Data;') #sql query to run in sql query = 'SELECT * FROM vw_Output_Data' #reading the sql query and placing the output in df cariable df= pd.read_sql(query, conn) # closing the connection -- !important conn.close()
# view the top 5 rows of your data df.head()