Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mu-map
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Tamino Huxohl
mu-map
Commits
6442ed68
Commit
6442ed68
authored
2 years ago
by
Tamino Huxohl
Browse files
Options
Downloads
Patches
Plain Diff
splits are now parsed as dicts
parent
b36a8455
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mu_map/data/split.py
+5
-3
5 additions, 3 deletions
mu_map/data/split.py
with
5 additions
and
3 deletions
mu_map/data/split.py
+
5
−
3
View file @
6442ed68
import
pandas
as
pd
from
typing
import
List
from
typing
import
Dict
,
List
def
parse_split_str
(
_str
:
str
,
delimitier
:
str
=
"
/
"
)
->
List
[
float
]:
...
...
@@ -23,7 +23,7 @@ def parse_split_str(_str: str, delimitier: str = "/") -> List[float]:
return
split
def
split_csv
(
data
:
pd
.
DataFrame
,
split_csv
:
str
)
->
List
[
pd
.
DataFrame
]:
def
split_csv
(
data
:
pd
.
DataFrame
,
split_csv
:
str
)
->
Dict
[
str
,
pd
.
DataFrame
]:
"""
Split a data frames based on a file defining a split.
...
...
@@ -40,7 +40,9 @@ def split_csv(data: pd.DataFrame, split_csv: str) -> List[pd.DataFrame]:
lambda
patient_ids
:
data
[
data
[
"
patient_id
"
].
isin
(
patient_ids
)],
split_patient_ids
,
)
return
list
(
splits
)
splits
=
zip
(
split_names
,
splits
)
splits
=
dict
(
splits
)
return
splits
if
__name__
==
"
__main__
"
:
...
...
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