Commit 3ba9f97a authored by 赵威's avatar 赵威

update score

parent 51937cd8
...@@ -246,14 +246,14 @@ def update_tag3_user_portrait(cl_id): ...@@ -246,14 +246,14 @@ def update_tag3_user_portrait(cl_id):
if not order_df.empty: if not order_df.empty:
paid_order_df = order_df[order_df["event_cn"] == "支付订单"] paid_order_df = order_df[order_df["event_cn"] == "支付订单"]
if not paid_order_df.empty: if not paid_order_df.empty:
paid_order_df["business_tags"] = list(zip(paid_order_df["business_tags"].apply(lambda x: x.split(",")), user_df["tag_score"])) paid_order_df["business_tags"] = list(zip(paid_order_df["business_tags"].apply(lambda x: x.split(",")), paid_order_df["tag_score"]))
paid_order_df["business_tags_dict"] = paid_order_df["business_tags"].apply(lambda x: make_dict_from_pair(x)) paid_order_df["business_tags_dict"] = paid_order_df["business_tags"].apply(lambda x: make_dict_from_pair(x))
paid_business_tags_list = paid_order_df["business_tags_dict"].tolist() paid_business_tags_list = paid_order_df["business_tags_dict"].tolist()
paid_business_tags_score = merge_values(paid_business_tags_list) paid_business_tags_score = merge_values(paid_business_tags_list)
validate_order_df = order_df[order_df["event_cn"] == "验证订单"] validate_order_df = order_df[order_df["event_cn"] == "验证订单"]
if not validate_order_df.empty: if not validate_order_df.empty:
validate_order_df["business_tags"] = list(zip(validate_order_df["business_tags"].apply(lambda x: x.split(",")), user_df["tag_score"])) validate_order_df["business_tags"] = list(zip(validate_order_df["business_tags"].apply(lambda x: x.split(",")), validate_order_df["tag_score"]))
validate_order_df["business_tags_dict"] = validate_order_df["business_tags"].apply(lambda x: make_dict_from_pair(x)) validate_order_df["business_tags_dict"] = validate_order_df["business_tags"].apply(lambda x: make_dict_from_pair(x))
validate_business_tags_list = validate_order_df["business_tags_dict"].tolist() validate_business_tags_list = validate_order_df["business_tags_dict"].tolist()
validate_business_tags_score = merge_values(validate_business_tags_list) validate_business_tags_score = merge_values(validate_business_tags_list)
...@@ -374,7 +374,7 @@ if __name__ == "__main__": ...@@ -374,7 +374,7 @@ if __name__ == "__main__":
cl_id = "867617044159377" cl_id = "867617044159377"
print(update_tag3_user_portrait(cl_id)) print(update_tag3_user_portrait(cl_id))
# consume_kafka() TODO # consume_kafka()
end = datetime.datetime.now() end = datetime.datetime.now()
print(end - start) print(end - start)
print("done") print("done")
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