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
e9bce7fd
Commit
e9bce7fd
authored
May 08, 2021
by
rico.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2eefae34
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
产品品牌更新.py
公共代码/产品品牌更新.py
+9
-7
重复产品更新.py
公共代码/重复产品更新.py
+3
-3
No files found.
公共代码/产品品牌更新.py
View file @
e9bce7fd
...
...
@@ -54,13 +54,15 @@ def duplicate_product_update(filepath,category,sheet_name=0):
brand_id_list
=
[]
for
brand_id_tuple
in
brand_id_fetch
:
brand_id_list
.
append
(
brand_id_tuple
[
0
])
existed_brand_list
=
[]
for
brand_id
in
brand_id_list
:
cursor_zi_new
.
execute
(
f
"select name from p_brand where id={brand_id}"
)
existed_brand_name
=
cursor_zi_new
.
fetchone
()
if
existed_brand_name
:
existed_brand_list
.
append
(
existed_brand_name
[
0
])
# existed_brand_list = []
# for brand_id in brand_id_list:
# cursor_zi_new.execute(f"select name from p_brand where id={brand_id}")
# existed_brand_name = cursor_zi_new.fetchone()
# if existed_brand_name:
# existed_brand_list.append(existed_brand_name[0])
brand_id_tuple
=
tuple
(
brand_id_list
)
cursor_zi_new
.
execute
(
f
"select name from p_brand where id in {brand_id_tuple}"
)
existed_brand_list
=
pd
.
DataFrame
((
cursor_zi_new
.
fetchall
()),
columns
=
[
'name'
])[
'name'
]
.
tolist
()
for
index
,
row
in
df
.
iterrows
():
if
type
(
row
[
'正确品牌'
])
!=
float
:
...
...
公共代码/重复产品更新.py
View file @
e9bce7fd
...
...
@@ -76,9 +76,9 @@ def duplicate_product_update(filepath,sheet_name=0):
if
__name__
==
'__main__'
:
# filepath="E:\\ZDZC\\激光打印机产品重复型号分析.xlsx"
filepath
=
"E:
\\
ZDZC
\\
处理后数据-扫描仪数据0407.xlsx"
sheet_name
=
'
重复产品'
duplicate_product_update
(
filepath
)
filepath
=
"E:
\\
ZDZC
\\
显示器重复产品分析0506.xlsx"
sheet_name
=
'
Sheet1'
duplicate_product_update
(
filepath
,
sheet_name
)
# filepath="E:\\ZDZC\\处理后数据-扫描仪数据0407.xlsx"
# sheet_name='重复产品'
...
...
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