Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
3ba9f97a
Commit
3ba9f97a
authored
Nov 18, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update score
parent
51937cd8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tag3_update_user_portrait_offline.py
eda/smart_rank/tag3_update_user_portrait_offline.py
+3
-3
No files found.
eda/smart_rank/tag3_update_user_portrait_offline.py
View file @
3ba9f97a
...
@@ -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
(
","
)),
us
er_df
[
"tag_score"
]))
paid_order_df
[
"business_tags"
]
=
list
(
zip
(
paid_order_df
[
"business_tags"
]
.
apply
(
lambda
x
:
x
.
split
(
","
)),
paid_ord
er_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
(
","
)),
us
er_df
[
"tag_score"
]))
validate_order_df
[
"business_tags"
]
=
list
(
zip
(
validate_order_df
[
"business_tags"
]
.
apply
(
lambda
x
:
x
.
split
(
","
)),
validate_ord
er_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"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment