Skip to content

Commit

Permalink
fix stage when it is nan
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-B98 committed Aug 24, 2024
1 parent dd30105 commit b0af344
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion pyAKI/kdigo.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def process_stay(self, stay_id: str) -> pd.DataFrame:
_df[[*columns]], how="outer", left_index=True, right_index=True
)

df["stage"] = df.filter(like="stage").max(axis=1).fillna(0)
df["stage"] = df.filter(like="stage").max(axis=1)
return df.set_index(
pd.MultiIndex.from_arrays(
[[stay_id] * len(df), df.index.values],
Expand Down
100 changes: 50 additions & 50 deletions test/data/validation_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -283,56 +283,56 @@ stay_id,charttime,urineoutput,urineoutput_stage,creat,abs_creatinine_stage,rel_c
32314488,2178-07-11 00:00:00,,,0.9,0.0,0.0,61.1,,,0.0,
32314488,2178-07-11 01:00:00,,,0.9,0.0,0.0,61.1,,,0.0,
32314488,2178-07-11 02:00:00,,,0.9,0.0,0.0,61.1,,,0.0,
32314488,2178-07-11 03:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 04:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 05:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 06:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 07:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 08:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 09:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 10:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 11:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 12:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 13:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 14:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 15:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 16:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 17:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 18:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 19:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 20:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 21:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 22:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 23:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 00:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 01:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 02:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 03:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 04:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 05:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 06:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 07:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 08:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 09:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 10:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 11:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 12:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 13:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 14:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 15:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 16:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 17:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 18:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 19:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 20:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 21:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 22:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-12 23:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-13 00:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-13 01:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-13 02:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-13 03:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-13 04:00:00,,,,,,61.1,,,0.0,
32314488,2178-07-11 03:00:00,,,,,,61.1,,,,
32314488,2178-07-11 04:00:00,,,,,,61.1,,,,
32314488,2178-07-11 05:00:00,,,,,,61.1,,,,
32314488,2178-07-11 06:00:00,,,,,,61.1,,,,
32314488,2178-07-11 07:00:00,,,,,,61.1,,,,
32314488,2178-07-11 08:00:00,,,,,,61.1,,,,
32314488,2178-07-11 09:00:00,,,,,,61.1,,,,
32314488,2178-07-11 10:00:00,,,,,,61.1,,,,
32314488,2178-07-11 11:00:00,,,,,,61.1,,,,
32314488,2178-07-11 12:00:00,,,,,,61.1,,,,
32314488,2178-07-11 13:00:00,,,,,,61.1,,,,
32314488,2178-07-11 14:00:00,,,,,,61.1,,,,
32314488,2178-07-11 15:00:00,,,,,,61.1,,,,
32314488,2178-07-11 16:00:00,,,,,,61.1,,,,
32314488,2178-07-11 17:00:00,,,,,,61.1,,,,
32314488,2178-07-11 18:00:00,,,,,,61.1,,,,
32314488,2178-07-11 19:00:00,,,,,,61.1,,,,
32314488,2178-07-11 20:00:00,,,,,,61.1,,,,
32314488,2178-07-11 21:00:00,,,,,,61.1,,,,
32314488,2178-07-11 22:00:00,,,,,,61.1,,,,
32314488,2178-07-11 23:00:00,,,,,,61.1,,,,
32314488,2178-07-12 00:00:00,,,,,,61.1,,,,
32314488,2178-07-12 01:00:00,,,,,,61.1,,,,
32314488,2178-07-12 02:00:00,,,,,,61.1,,,,
32314488,2178-07-12 03:00:00,,,,,,61.1,,,,
32314488,2178-07-12 04:00:00,,,,,,61.1,,,,
32314488,2178-07-12 05:00:00,,,,,,61.1,,,,
32314488,2178-07-12 06:00:00,,,,,,61.1,,,,
32314488,2178-07-12 07:00:00,,,,,,61.1,,,,
32314488,2178-07-12 08:00:00,,,,,,61.1,,,,
32314488,2178-07-12 09:00:00,,,,,,61.1,,,,
32314488,2178-07-12 10:00:00,,,,,,61.1,,,,
32314488,2178-07-12 11:00:00,,,,,,61.1,,,,
32314488,2178-07-12 12:00:00,,,,,,61.1,,,,
32314488,2178-07-12 13:00:00,,,,,,61.1,,,,
32314488,2178-07-12 14:00:00,,,,,,61.1,,,,
32314488,2178-07-12 15:00:00,,,,,,61.1,,,,
32314488,2178-07-12 16:00:00,,,,,,61.1,,,,
32314488,2178-07-12 17:00:00,,,,,,61.1,,,,
32314488,2178-07-12 18:00:00,,,,,,61.1,,,,
32314488,2178-07-12 19:00:00,,,,,,61.1,,,,
32314488,2178-07-12 20:00:00,,,,,,61.1,,,,
32314488,2178-07-12 21:00:00,,,,,,61.1,,,,
32314488,2178-07-12 22:00:00,,,,,,61.1,,,,
32314488,2178-07-12 23:00:00,,,,,,61.1,,,,
32314488,2178-07-13 00:00:00,,,,,,61.1,,,,
32314488,2178-07-13 01:00:00,,,,,,61.1,,,,
32314488,2178-07-13 02:00:00,,,,,,61.1,,,,
32314488,2178-07-13 03:00:00,,,,,,61.1,,,,
32314488,2178-07-13 04:00:00,,,,,,61.1,,,,
32314488,2178-07-13 05:00:00,,,0.6,0.0,0.0,61.1,,,0.0,
32314488,2178-07-13 06:00:00,,,0.6,0.0,0.0,61.1,,,0.0,
32314488,2178-07-13 07:00:00,,,0.6,0.0,0.0,61.1,,,0.0,
Expand Down

0 comments on commit b0af344

Please sign in to comment.