in covidprognosis/data/mimic_cxr.py [0:0]
def preproc_csv(self, csv: pd.DataFrame, subselect: Optional[str]) -> pd.DataFrame:
if csv is not None:
def format_view(s):
if s in ("AP", "PA", "AP|PA"):
return "frontal"
elif s in ("LATERAL", "LL"):
return "lateral"
else:
return None
csv["view"] = csv.ViewPosition.apply(format_view)
if subselect is not None:
csv = csv.query(subselect)
return csv