Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- q1= ("SELECT * FROM dzlog WHERE ullid=49876996433 AND sheetid=6394503;")
- engine = create_engine('pgfdw://postgres:test@123@localhost:5432/mydb')
- connection = engine.connect()
- pd.read_sql(q1, connection)
- q2=("SELECT * from sheetheight WHERE ullid=49876883285 AND sheetid=6391745;")
- engine = create_engine('pgfdw://postgres:test@123@localhost:5432/mydb')
- connection = engine.connect()
- pd.read_sql(q2, connection)
- import psycopg2
- connection = psycopg2.connect("dbname='mydb' user='qfsa' host='localhost' password='123' port=5433")
- cursor=connection.cursor()
- pd.read_sql(q1,cursor)
- df=pd.read_csv('.sourcessheetHeight.csv', delimiter=',')
- df.loc[(df['ullid']==49876883285 ) & (df['sheetid'==6391745)]
- import timit
- start_time = timeit.default_timer()
- ...Execution of query...
- elapsed = timeit.default_timer()-start_time
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement