Commit 0b7df7a5 authored by 张彦钊's avatar 张彦钊

add print

parent b02c21eb
......@@ -10,6 +10,7 @@ from multiprocessing import Pool
from config import *
import json
from sklearn.preprocessing import MinMaxScaler
import time
def test_con_sql(device_id):
db = pymysql.connect(host='rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com', port=3306, user='doris',
......@@ -145,15 +146,15 @@ def merge_score(x_list, score_df):
cursor.execute(sql)
result = cursor.fetchall()
score = pd.DataFrame(list(result))
print("数据库日记表前十行")
print(score)
# print("数据库日记表前十行")
# print(score)
score_list = score[0].values.tolist()
db.close()
score_df["score"] = score_df["score"] + score_list
print("sum")
print(score_df)
# print("sum")
# print(score_df)
return score_df
......@@ -214,6 +215,7 @@ def multi_update(key, name_dict):
if __name__ == "__main__":
start = time.time()
warnings.filterwarnings("ignore")
# TODO 上线后把预测用户改成多进程预测
data_set_cid = pd.read_csv(DIRECTORY_PATH + "data_set_cid.csv")["cid"].values.tolist()
......@@ -225,6 +227,8 @@ if __name__ == "__main__":
for key in name_dict.keys():
multi_update(key, name_dict)
end = time.time()
print(end-start)
# pool = Pool(4)
# for key in name_dict.keys():
# pool.apply_async(multi_update,(key,name_dict,))
......
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