Commit c3b68a4d authored by rico.liu's avatar rico.liu

update

parent a87c2a18
This diff is collapsed.
......@@ -10,13 +10,14 @@ import match_program
import pandas as pd
import pymssql
import pymysql
'''
test data load
'''
def get_test_data():
'''
conn = pymssql.connect('123.56.115.207','zgcindex','jiayou2017+2018','ZI_DataBase')
cursor = conn.cursor()
#cursor.execute("select * from vw_electricity_source_price where ProductCode in "+ code_list +" and periods = (select top 1 periods from vw_entry_source_price order by periods desc)")
......@@ -25,6 +26,16 @@ def get_test_data():
cursor.close()
conn.close()
'''
conn = pymysql.connect('59.110.219.171','root','qwertyuiop1','product_chongqin')
cursor = conn.cursor()
#cursor.execute("select * from vw_electricity_source_price where ProductCode in "+ code_list +" and periods = (select top 1 periods from vw_entry_source_price order by periods desc)")
cursor.execute("select * from product")
test_df = pd.DataFrame([v for v in cursor.fetchall()],columns=[tuple[0] for tuple in cursor.description])
cursor.close()
conn.close()
return test_df
test_df = get_test_data()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment