Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 6, 2024
1 parent 87d4749 commit d5ee511
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aisdc/preprocessing/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ def _mimic_iaccd(data_folder: str) -> Tuple[pd.DataFrame, pd.DataFrame]:

return (X, y)


def _RDMP( # pylint: disable=too-many-locals, too-many-statements
data_folder: str,
) -> Tuple[pd.DataFrame, pd.DataFrame]:
Expand Down Expand Up @@ -590,7 +591,7 @@ def hospital_days(row):
]

# Process first file
df = pd.read_csv(files_path[0], usecols=headers0, encoding='ISO 8859-1')
df = pd.read_csv(files_path[0], usecols=headers0, encoding="ISO 8859-1")

Check warning on line 594 in aisdc/preprocessing/loaders.py

View check run for this annotation

Codecov / codecov/patch

aisdc/preprocessing/loaders.py#L594

Added line #L594 was not covered by tests
# Change name to be the same in all files
df.rename(columns={"PatientID": "chi"}, inplace=True)
df = df.groupby(["chi"]).max()

Check warning on line 597 in aisdc/preprocessing/loaders.py

View check run for this annotation

Codecov / codecov/patch

aisdc/preprocessing/loaders.py#L596-L597

Added lines #L596 - L597 were not covered by tests
Expand All @@ -606,7 +607,7 @@ def hospital_days(row):
del df_

Check warning on line 607 in aisdc/preprocessing/loaders.py

View check run for this annotation

Codecov / codecov/patch

aisdc/preprocessing/loaders.py#L606-L607

Added lines #L606 - L607 were not covered by tests

# Process third file
df__ = pd.read_csv(files_path[2], usecols=headers2, encoding='ISO 8859-1')
df__ = pd.read_csv(files_path[2], usecols=headers2, encoding="ISO 8859-1")
df__["AdmissionDate"] = pd.to_datetime(df__["AdmissionDate"])
df__["DischargeDate"] = pd.to_datetime(df__["DischargeDate"])
df__["days_in_hospital"] = df__.apply(hospital_days, axis=1)
Expand Down

0 comments on commit d5ee511

Please sign in to comment.