Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
重
重点类信息提取
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ZGC_INDEX
重点类信息提取
Commits
5f7f3949
Commit
5f7f3949
authored
May 08, 2021
by
Jialin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码更新
parent
62dacfbd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
产品重复型号分析.py
公共代码/产品重复型号分析.py
+16
-3
No files found.
公共代码/产品重复型号分析.py
View file @
5f7f3949
...
...
@@ -33,6 +33,7 @@ def product_washing(filepath, category, thre=1, a=0):
for
param
in
other_parameters_fetch
:
other_parameters
.
append
(
param
[
0
])
point_category_list
=
[
'台式机'
,
'笔记本'
,
'一体电脑'
,
'复印纸'
]
related_product
=
[]
brand_grouped
=
df
.
groupby
(
by
=
'产品品牌'
)
for
brand
in
brand_grouped
:
...
...
@@ -41,6 +42,15 @@ def product_washing(filepath, category, thre=1, a=0):
tempo_dict
=
{}
# 每个品牌提取产品型号关键字,放入tempo_dict
for
i
in
brand
[
1
]
.
index
:
if
category
in
point_category_list
:
if
category
==
'复印纸'
:
k
=
brand
[
1
]
.
loc
[
i
,
'*产品系列'
]
else
:
k
=
brand
[
1
]
.
loc
[
i
,
'*产品子系列'
]
k
.
replace
(
' '
,
''
)
.
replace
(
'系列'
,
''
)
.
replace
(
'_'
,
''
)
.
replace
(
'-'
,
''
)
.
upper
()
tempo_dict
[
i
]
=
[
k
]
else
:
k
=
brand
[
1
]
.
loc
[
i
,
'*产品型号'
]
if
k
in
invalid_list
:
continue
...
...
@@ -119,7 +129,10 @@ def product_washing(filepath, category, thre=1, a=0):
if
count
!=
0
:
tested_product
.
append
(
set
([
i
,
j
]))
break
# 如果出现了必须相等但不相等的参数,则退出到上一层循环。如果没有出现,则对比型号
if
category
in
point_category_list
:
if
tempo_dict
[
i
][
0
]
==
tempo_dict
[
j
][
0
]:
related_product
.
append
(
set
([
i
,
j
]))
else
:
accuracy_i
=
0
accuracy_j
=
0
for
word_i
in
tempo_dict
[
i
][
0
]:
...
...
@@ -179,6 +192,6 @@ def product_washing(filepath, category, thre=1, a=0):
if
__name__
==
'__main__'
:
filepath
=
"E:
\\
ZDZC
\\
激光打印机
参数确认.xlsx"
category
=
'
激光打印机
'
filepath
=
"E:
\\
ZDZC
\\
Sourcetree_local
\\
公共代码
\\
一体电脑
参数确认.xlsx"
category
=
'
一体电脑
'
product_washing
(
filepath
,
category
)
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