Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
concepts-processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
meldb
concepts-processing
Commits
8f8b5119
Commit
8f8b5119
authored
4 months ago
by
Jakub Dylag
Browse files
Options
Downloads
Patches
Plain Diff
move summary excel into json config
parent
28f44a19
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+7
-16
7 additions, 16 deletions
main.py
process_codes_WP.ipynb
+610
-596
610 additions, 596 deletions
process_codes_WP.ipynb
with
617 additions
and
612 deletions
main.py
+
7
−
16
View file @
8f8b5119
...
@@ -255,23 +255,14 @@ def run_all(mapping_file, target_code_type,
...
@@ -255,23 +255,14 @@ def run_all(mapping_file, target_code_type,
out
=
out
.
drop_duplicates
(
subset
=
[
"
CONCEPT_SET
"
,
"
CONCEPT
"
])
out
=
out
.
drop_duplicates
(
subset
=
[
"
CONCEPT_SET
"
,
"
CONCEPT
"
])
out
=
out
.
sort_values
(
by
=
[
"
CONCEPT_SET
"
,
"
CONCEPT
"
])
out
=
out
.
sort_values
(
by
=
[
"
CONCEPT_SET
"
,
"
CONCEPT
"
])
#Merge with Concept Types in Summary Excel File
#Add Concept Set Defintions metadata
if
"
excel_sheet
"
in
summary_config
:
summary_df
=
pd
.
DataFrame
(
summary_config
[
"
concept_set
"
])
#transform to dataframe
summary_df
=
read_table_file
(
summary_config
[
"
file
"
],
excel_sheet
=
summary_config
[
"
excel_sheet
"
])
if
"
metadata
"
in
summary_df
.
columns
:
else
:
summary_df
=
summary_df
.
join
(
pd
.
json_normalize
(
summary_df
[
"
metadata
"
]))
#metadata to columns
summary_df
=
read_table_file
(
summary_config
[
"
file
"
])
summary_df
=
summary_df
.
drop
(
columns
=
[
"
metadata
"
])
summary_cols_all
=
[]
#get all column names
summary_df
=
summary_df
.
rename
(
columns
=
{
"
concept_set_name
"
:
"
CONCEPT_SET
"
})
for
v
in
summary_config
[
"
columns
"
].
values
():
#TODO: put in seperate function - get all columns in JSON file object
if
type
(
v
)
==
str
:
summary_cols_all
.
append
(
v
)
else
:
summary_cols_all
+=
v
output_version
=
summary_config
[
"
version
"
]
summary_df
=
summary_df
[
summary_cols_all
]
#select all relevant columns
summary_df
=
summary_df
.
rename
(
columns
=
{
summary_config
[
"
columns
"
][
"
concept_set_name
"
]:
"
CONCEPT_SET
"
})
summary_df
=
summary_df
.
drop_duplicates
()
#remove duplicates
summary_df
=
summary_df
.
drop_duplicates
()
#remove duplicates
out
=
out
.
merge
(
summary_df
,
how
=
"
left
"
,
on
=
'
CONCEPT_SET
'
)
out
=
out
.
merge
(
summary_df
,
how
=
"
left
"
,
on
=
'
CONCEPT_SET
'
)
#merge with output
# Save Output File
# Save Output File
print
(
bcolors
.
HEADER
,
"
---
"
*
5
,
"
OUTPUT
"
,
"
---
"
*
5
,
bcolors
.
ENDC
)
print
(
bcolors
.
HEADER
,
"
---
"
*
5
,
"
OUTPUT
"
,
"
---
"
*
5
,
bcolors
.
ENDC
)
...
...
This diff is collapsed.
Click to expand it.
process_codes_WP.ipynb
+
610
−
596
View file @
8f8b5119
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment