Skip to content
Snippets Groups Projects
Commit 6442ed68 authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

splits are now parsed as dicts

parent b36a8455
No related branches found
No related tags found
No related merge requests found
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__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment