Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Amazon-Selection-Data
Overview
Overview
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
abel_cjy
Amazon-Selection-Data
Commits
940661c9
Commit
940661c9
authored
Aug 11, 2026
by
hejiangming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
年度搜索词更新品牌标记
parent
0e084865
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
dwt_aba_last365.py
Pyspark_job/dwt/dwt_aba_last365.py
+3
-1
No files found.
Pyspark_job/dwt/dwt_aba_last365.py
View file @
940661c9
...
...
@@ -486,7 +486,9 @@ class DwtAbaLast365(object):
# 影视品牌标签
self
.
df_label
=
self
.
df_label
.
groupBy
(
'search_term'
)
.
agg
(
F
.
round
((
F
.
sum
(
"asin_movie_type_count"
)
/
F
.
sum
(
"total_asin_num"
))
*
100
,
2
)
.
alias
(
'movie_prop'
),
F
.
max
(
'st_brand_label'
)
.
alias
(
'st_brand_label'
)
# ===== 原逻辑(保留备查):F.max('st_brand_label') 12个月只要1个月标品牌就算品牌,旧月份拖累年表 =====
# 改为频率口径:12个月(固定分母)中 st_brand_label=1 的月数 >=6 才标品牌,<6 不标
F
.
when
(
F
.
sum
(
'st_brand_label'
)
>=
6
,
F
.
lit
(
1
))
.
otherwise
(
F
.
lit
(
0
))
.
alias
(
'st_brand_label'
)
)
.
withColumn
(
# 影视标记类型 0:非影视; 1:0< 比例 <= 20%; 2: 20% < 比例 <= 50%; 3:50% < 比例
'st_movie_label'
,
...
...
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