Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tool-code
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
tool-code
Commits
a840dfd0
Commit
a840dfd0
authored
Dec 10, 2021
by
rico.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add model
parent
5adb0e1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
zgcindex_data2DB.py
数据治理平台线下处理/线下建库/zgcindex_data2DB.py
+14
-1
No files found.
数据治理平台线下处理/线下建库/zgcindex_data2DB.py
View file @
a840dfd0
...
...
@@ -53,11 +53,24 @@ categoryId_list = df['FINISH_P_LASTCATEGORY_CODE'].apply(lambda x:str(x)).tolist
name_list
=
df
[
'FINISH_P_NAME'
]
.
tolist
()
#params_list = df['FINISH_P_PARAMS'].apply(lambda x:eval(x.replace("null","{}").replace("无","{}"))).tolist()
df
[
'FINISH_P_MODEL'
]
=
df
[
'FINISH_P_MODEL'
]
.
apply
(
lambda
x
:
str
(
x
))
df
[
'DEAL_FINISH_P_MODEL'
]
=
df
[
'FINISH_P_MODEL'
]
.
apply
(
lambda
x
:
0
if
x
==
'无'
or
x
==
'nan'
else
x
)
params_list
=
[
eval
(
params
)
if
"{"
in
params
else
eval
(
"{}"
)
for
params
in
df
[
'FINISH_P_PARAMS'
]
.
tolist
()]
deal_params_list
=
[]
for
params
,
model
in
zip
(
params_list
,
df
[
'DEAL_FINISH_P_MODEL'
]
.
tolist
()):
for
key
in
list
(
params
.
keys
()):
if
params
[
key
]
==
'需人工补充'
:
del
params
[
key
]
if
model
==
0
:
pass
else
:
params
.
update
({
'产品型号'
:
model
})
deal_params_list
.
append
(
params
)
res
=
stock_in_product
(
brand_list
,
brandId_list
,
category_list
,
categoryId_list
,
params_list
,
name_list
)
res
=
stock_in_product
(
brand_list
,
brandId_list
,
category_list
,
categoryId_list
,
deal_
params_list
,
name_list
)
print
(
res
)
sku_list
=
res
[
'sku_list'
]
had_sku_list
=
res
[
'had_sku_list'
]
...
...
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