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
62f91a09
Commit
62f91a09
authored
Mar 04, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get result
parent
a5a58b9a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
tag3_update_user_portrait_offline.py
eda/smart_rank/tag3_update_user_portrait_offline.py
+16
-7
No files found.
eda/smart_rank/tag3_update_user_portrait_offline.py
View file @
62f91a09
...
...
@@ -6,6 +6,7 @@ from tool import get_tag3_user_log
# [{'激光': 1.949194898204873}, {'手术': 1.949194898204873}, {'手术': 1.949194898204873}, {'手术': 1.949194898204873}]
# {'手术': 5.8475846946146195, '激光': 1.949194898204873}
def
merge_values
(
list_of_dict
):
return
dict
(
functools
.
reduce
(
operator
.
add
,
map
(
Counter
,
list_of_dict
)))
...
...
@@ -49,16 +50,24 @@ def update_tag3_user_portrait(cl_id):
second_positions_list
=
user_df
[
"second_positions_dict"
]
.
tolist
()
projects_list
=
user_df
[
"projects_dict"
]
.
tolist
()
print
(
first_solutions_list
)
print
(
merge_values
(
first_solutions_list
),
"
\n
"
)
res
=
{
"first_demands"
:
merge_values
(
first_demands_list
),
"second_demands"
:
merge_values
(
second_demands_list
),
"first_solutions"
:
merge_values
(
first_solutions_list
),
"second_solutions"
:
merge_values
(
second_solutions_list
),
"first_positions"
:
merge_values
(
first_positions_list
),
"second_positions"
:
merge_values
(
second_positions_list
),
"projects"
:
merge_values
(
projects_list
)
}
print
(
second_solutions_list
,
"
\n
"
)
print
(
merge_values
(
second_solutions_list
))
# cl_id_portrait_key = "doris:test:device_id:" + str(cl_id)
# redis_client.set(cl_id_portrait_key, json.dumps(res))
# redis_client.expire(cl_id_portrait_key, 60*60*24)
print
(
first_demands_list
,
"
\n
"
)
print
(
merge_values
(
first_demands_list
))
return
res
if
__name__
==
"__main__"
:
cl_id
=
"866017030837899"
update_tag3_user_portrait
(
cl_id
)
res
=
update_tag3_user_portrait
(
cl_id
)
print
(
res
)
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