Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
ZHOUXINGYU_project
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
zhou
ZHOUXINGYU_project
Commits
bcdfdf70
Commit
bcdfdf70
authored
Mar 18, 2020
by
zhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update function.py
parent
26f3b891
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
function.py
function.py
+13
-6
No files found.
function.py
View file @
bcdfdf70
...
...
@@ -137,7 +137,7 @@ class tool():
brandcode_original
=
str
(
brandcode_original
)
.
zfill
(
5
)[
-
5
:]
#print(brandcode_original)
#print(self.brand_table[self.brand_table['BrandID']==brandcode_original]['BrandName'].tolist())
if
brandcode_original
==
'应指数品牌'
or
'错误品牌'
in
self
.
brand_table
[
self
.
brand_table
[
'BrandID'
]
==
brandcode_original
][
'BrandName'
]
.
tolist
()[
0
]:
if
brandcode_original
==
'
没有对
应指数品牌'
or
'错误品牌'
in
self
.
brand_table
[
self
.
brand_table
[
'BrandID'
]
==
brandcode_original
][
'BrandName'
]
.
tolist
()[
0
]:
BRANDID
=
'没有对应指数品牌'
for
ID
,
Chinese_brand
,
English_brand
in
zip
(
self
.
brand_table
[
'BrandID'
],
self
.
brand_table
[
'中文品牌'
],
self
.
brand_table
[
'英文品牌'
]):
if
brand
==
Chinese_brand
:
...
...
@@ -192,7 +192,13 @@ def judge_unit(string):
def
type_extract_JD
(
name
,
params
,
brand
):
#params = eval(params)
try
:
brand_remove
=
re
.
findall
(
r"[A-Za-z0-9]+"
,
brand
)[
0
]
.
upper
()
brand_remove_lyst
=
re
.
findall
(
r"[A-Za-z0-9]+"
,
brand
)
try
:
brand_remove_lyst
.
append
(
brand
.
split
(
'/'
)[
-
1
])
brand_remove_lyst
.
append
(
f
"{brand.split('/')[-1]}/"
)
brand_remove_lyst
.
append
(
f
"/{brand.split('/')[-1]}"
)
except
:
pass
except
IndexError
:
brand_remove
=
'没有英文品牌!'
param_xinghao
=
'NA'
...
...
@@ -205,8 +211,9 @@ def type_extract_JD(name, params, brand):
name_xinghao_lyst
=
list
(
filter
(
lambda
x
:
len
(
x
)
>=
2
,
re
.
findall
(
r"[A-Za-z0-9-+/.*]+"
,
name
)))
for
i
in
range
(
len
(
name_xinghao_lyst
)):
name_xinghao_lyst
[
i
]
=
name_xinghao_lyst
[
i
]
.
upper
()
for
brand_remove
in
brand_remove_lyst
:
try
:
name_xinghao_lyst
.
remove
(
brand_remove
)
name_xinghao_lyst
.
remove
(
brand_remove
.
upper
()
)
except
ValueError
:
pass
if
len
(
name_xinghao_lyst
)
==
0
:
...
...
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