Advertisement
Guest User

Untitled

a guest
Apr 7th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import pandas as pd
  2. q1= ("SELECT * FROM dzlog WHERE ullid=49876996433 AND sheetid=6394503;")
  3. engine = create_engine('pgfdw://postgres:test@123@localhost:5432/mydb')
  4. connection = engine.connect()
  5. pd.read_sql(q1, connection)
  6.  
  7. q2=("SELECT * from sheetheight WHERE ullid=49876883285 AND sheetid=6391745;")
  8. engine = create_engine('pgfdw://postgres:test@123@localhost:5432/mydb')
  9. connection = engine.connect()
  10. pd.read_sql(q2, connection)
  11.  
  12. import psycopg2
  13. connection = psycopg2.connect("dbname='mydb' user='qfsa' host='localhost' password='123' port=5433")
  14. cursor=connection.cursor()
  15. pd.read_sql(q1,cursor)
  16.  
  17. df=pd.read_csv('.sourcessheetHeight.csv', delimiter=',')
  18. df.loc[(df['ullid']==49876883285 ) & (df['sheetid'==6391745)]
  19.  
  20. import timit
  21. start_time = timeit.default_timer()
  22. ...Execution of query...
  23. elapsed = timeit.default_timer()-start_time
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement