Commit fdbec39a authored by 张彦钊's avatar 张彦钊

修改sql

parent 61826075
...@@ -20,11 +20,15 @@ def con_sql(db,sql): ...@@ -20,11 +20,15 @@ def con_sql(db,sql):
def get_data(): def get_data():
db = pymysql.connect(host='10.66.157.22', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='jerry_prod') db = pymysql.connect(host='10.66.157.22', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='jerry_prod')
sql = "select * from esmm_data where stat_date >= '2018-11-20'" sql = "select * from esmm_data where stat_date >= '2018-11-20'"
df = con_sql(db,sql) esmm = con_sql(db,sql)
print("esmm data ok")
print(esmm.head())
db = pymysql.connect(host='10.66.157.22', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='eagle') db = pymysql.connect(host='10.66.157.22', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='eagle')
sql = "select * from home_tab_click" sql = "select * from home_tab_click"
temp = con_sql(db,sql) temp = con_sql(db,sql)
df = pd.merge(df,temp,on = "device_id") print("click data ok")
print(temp.head())
df = pd.merge(esmm,temp,on = "device_id")
print(df.head()) print(df.head())
......
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