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
fb874064
Commit
fb874064
authored
Sep 10, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2868fdda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
portary_div_exposure.py
utils/portary_div_exposure.py
+9
-10
No files found.
utils/portary_div_exposure.py
View file @
fb874064
...
@@ -363,10 +363,9 @@ def from_id_get_tag(card_id_dict):
...
@@ -363,10 +363,9 @@ def from_id_get_tag(card_id_dict):
return
query_count
return
query_count
def
save_data_to_csv
(
all_tags
,
user_portrait_dict
,
word_count_exposure
):
def
save_data_to_csv
(
user_portrait_dict
,
word_count_exposure
):
all_data
=
[]
all_data
=
[]
for
tag
in
user_portrait_dict
:
for
tag
in
all_tags
:
data_type
=
""
data_type
=
""
data_count
=
""
data_count
=
""
diary_exposure
=
0
diary_exposure
=
0
...
@@ -375,12 +374,12 @@ def save_data_to_csv(all_tags,user_portrait_dict,word_count_exposure):
...
@@ -375,12 +374,12 @@ def save_data_to_csv(all_tags,user_portrait_dict,word_count_exposure):
user_portrait
=
user_portrait_dict
.
get
(
tag
)
user_portrait
=
user_portrait_dict
.
get
(
tag
)
if
user_portrait
:
if
user_portrait
:
data_type
,
data_count
=
user_portrait
data_type
,
data_count
=
user_portrait
if
word_count_exposure
[
"diary"
]
.
get
(
"tag"
):
if
word_count_exposure
[
"diary"
]
.
get
(
tag
):
diary_exposure
=
word_count_exposure
[
"diary"
]
.
get
(
"tag"
)
diary_exposure
=
word_count_exposure
[
"diary"
]
.
get
(
tag
)
if
word_count_exposure
[
"answer"
]
.
get
(
"tag"
):
if
word_count_exposure
[
"answer"
]
.
get
(
tag
):
answer_exposure
=
word_count_exposure
[
"answer"
]
.
get
(
"tag"
)
answer_exposure
=
word_count_exposure
[
"answer"
]
.
get
(
tag
)
if
word_count_exposure
[
"tractate"
]
.
get
(
"tag"
):
if
word_count_exposure
[
"tractate"
]
.
get
(
tag
):
tractate_exposure
=
word_count_exposure
[
"tractate"
]
.
get
(
"tag"
)
tractate_exposure
=
word_count_exposure
[
"tractate"
]
.
get
(
tag
)
all_data
.
append
((
data_type
,
data_count
,
diary_exposure
,
answer_exposure
,
tractate_exposure
))
all_data
.
append
((
data_type
,
data_count
,
diary_exposure
,
answer_exposure
,
tractate_exposure
))
print
(
all_data
[
-
1
])
print
(
all_data
[
-
1
])
...
@@ -408,7 +407,7 @@ def parse_data():
...
@@ -408,7 +407,7 @@ def parse_data():
# 获取曝光id对应的标签
# 获取曝光id对应的标签
word_count_exposure
=
from_id_get_tag
(
card_id_dict
)
word_count_exposure
=
from_id_get_tag
(
card_id_dict
)
print
(
word_count_exposure
)
print
(
word_count_exposure
)
save_data_to_csv
(
all_tags
,
user_portrait_dict
,
word_count_exposure
)
save_data_to_csv
(
user_portrait_dict
,
word_count_exposure
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
parse_data
()
parse_data
()
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