Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
meta_base_code
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黎涛
meta_base_code
Commits
d22aa05c
Commit
d22aa05c
authored
Sep 16, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
719e83b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
+30
-19
new_user_has_protratit_rate.py
new_user_analysis/new_user_has_protratit_rate.py
+30
-19
No files found.
new_user_analysis/new_user_has_protratit_rate.py
View file @
d22aa05c
...
...
@@ -178,30 +178,41 @@ WHERE spam_pv.device_id IS NULL
new_urser_device_id_df
.
createOrReplaceTempView
(
"device_id_view"
)
new_urser_device_id_df
.
show
(
1
)
sql_res
=
new_urser_device_id_df
.
collect
()
res_dict
=
{}
portrait_dict
=
{
"first_demands"
:
{},
"second_demands"
:
{},
"first_solutions"
:
{},
"second_solutions"
:
{},
"first_positions"
:
{},
"second_positions"
:
{},
"projects"
:
{},
}
print
(
"-------------------------------"
)
for
count
,
res
in
enumerate
(
sql_res
):
count_not_has_portratit
=
0
for
count_user_count
,
res
in
enumerate
(
sql_res
):
# print(count, res)
portratit_res
=
get_user_portrait_tag3_from_redis
(
res
.
device_id
)
print
(
count
,
res
,
portratit_res
)
# res_dict = {}
#
# print(count_user_count, res, portratit_res)
temp_count
=
0
for
demand
in
portratit_res
:
if
portratit_res
[
demand
]:
for
tag
in
portratit_res
[
demand
][
0
:
3
]:
if
tag
in
portrait_dict
[
demand
]:
portrait_dict
[
demand
][
tag
]
+=
1
else
:
portrait_dict
[
demand
][
tag
]
=
1
temp_count
+=
1
if
not
temp_count
:
count_not_has_portratit
+=
1
print
(
portrait_dict
)
print
(
count_user_count
+
1
,
count_not_has_portratit
)
print
(
"-------------------------------"
)
# for count, res in enumerate(sql_res):
# # print(count, res)
# track = res.track
# if not track:
# continue
# track_list = track.split(",")
# for one_key_word in track_list:
# if one_key_word in res_dict:
# res_dict[one_key_word] += 1
# else:
# res_dict[one_key_word] = 1
# print(res_dict)
#
# exception_list = ("report_status","is_open_push")
# for action in res_dict:
# partition_date = yesterday_str
# pid = hashlib.md5((partition_date + action).encode("utf8")).hexdigest()
...
...
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