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
60dd1d66
Commit
60dd1d66
authored
Apr 15, 2021
by
rico.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4d8734d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
模板建库func.py
模板建库func.py
+7
-2
No files found.
模板建库func.py
View file @
60dd1d66
...
...
@@ -461,10 +461,13 @@ def check_params_data(path):
try
:
point_category
=
category
.
replace
(
'/'
,
'_'
)
cat_df
=
pd
.
read_excel
(
path
,
sheetname
=
f
"{point_category}参数数据"
,
converters
=
{
'productcode'
:
str
})
cat_df
=
pd
.
read_excel
(
path
,
sheet
_
name
=
f
"{point_category}参数数据"
,
converters
=
{
'productcode'
:
str
})
except
:
continue
#加载标准项
cat_subtitle_list
=
db_params
[
db_params
[
'name'
]
==
category
][
'subtitle'
]
.
tolist
()
#加载数据字典
cursor_zi_new
.
execute
(
f
"select subtitle,stdvalue,primitive,simplevalue from ShuJuZiDian_Cfg where categoryname = '{category}'"
)
data_dict
=
pd
.
DataFrame
(
cursor_zi_new
.
fetchall
(),
columns
=
[
tuple
[
0
]
for
tuple
in
cursor_zi_new
.
description
])
...
...
@@ -492,7 +495,9 @@ def check_params_data(path):
single_df
[
'filter'
]
=
[
'1'
if
'(*)'
in
param
else
'0'
for
param
in
single_df
[
'param'
]
.
tolist
()]
single_df
=
single_df
[
single_df
[
'filter'
]
==
'1'
]
params_dict
=
dict
(
zip
(
single_df
[
'param'
]
.
apply
(
lambda
x
:
x
.
replace
(
"(*)"
,
""
))
.
tolist
(),
single_df
[
'value'
]
.
tolist
()))
params_dict
=
dict
(
zip
(
cat_subtitle_list
,[
single_df
[
single_df
[
'param'
]
==
subtitle
+
'(*)'
][
'value'
]
.
tolist
()[
0
]
for
subtitle
in
cat_subtitle_list
]))
params_list
.
append
(
params_dict
)
print
(
f
"{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