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

delete prints

parent 6a1f914d
...@@ -101,7 +101,7 @@ def multi_predict(predict_list,processes=12): ...@@ -101,7 +101,7 @@ def multi_predict(predict_list,processes=12):
if __name__ == "__main__": if __name__ == "__main__":
# TODO 如果耗时小于一分钟,下一次取到的device_id和上一次相同 # TODO 如果耗时小于一分钟,下一次取到的device_id和上一次相同。还有一种情况,一个用户持续活跃,会被重复预测
while True: while True:
empty,device_id_list = get_active_users() empty,device_id_list = get_active_users()
if empty: if empty:
...@@ -115,7 +115,7 @@ if __name__ == "__main__": ...@@ -115,7 +115,7 @@ if __name__ == "__main__":
predict_list = list(set(device_id_list) & set(old_device_id_list)) predict_list = list(set(device_id_list) & set(old_device_id_list))
multi_predict(predict_list) multi_predict(predict_list)
#TODO 上线前把预测流程中的计时器、打印代码删掉或者注释,因为预测对性能要求高,能少一条执行语句就少一条执行语句 #TODO 上线前把预测流程中的计时器、打印代码删掉或者注释,因为预测对性能要求高,能少一条代码语句就少一条
......
...@@ -17,7 +17,6 @@ def get_active_users(): ...@@ -17,7 +17,6 @@ def get_active_users():
device_id_list = device_id_df[0].values.tolist() device_id_list = device_id_df[0].values.tolist()
# 对device_id 进行去重 # 对device_id 进行去重
device_id_list = list(set(device_id_list)) device_id_list = list(set(device_id_list))
print("成功获取当下一分钟内活跃用户")
return False,device_id_list return False,device_id_list
...@@ -29,7 +28,6 @@ def fetch_user_profile(device_id): ...@@ -29,7 +28,6 @@ def fetch_user_profile(device_id):
return None,True return None,True
else: else:
user_profile = user_profile.rename(columns={0:"device_id",1:"city_id"}) user_profile = user_profile.rename(columns={0:"device_id",1:"city_id"})
print("成功获取该用户对应的city_id")
user_profile_dict = {} user_profile_dict = {}
for i in user_profile.columns: for i in user_profile.columns:
user_profile_dict[i] = user_profile.loc[0, i] user_profile_dict[i] = user_profile.loc[0, i]
......
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