Skip to content

Commit

Permalink
Merge pull request #81 from AI2MS/issue/80-uo-nan-values
Browse files Browse the repository at this point in the history
fix nan values
  • Loading branch information
aegis301 authored Nov 18, 2023
2 parents 7b87de8 + 36266be commit f33beb6
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 98 deletions.
4 changes: 3 additions & 1 deletion pyAKI/probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def probe(

weight: pd.Series = patient["weight"]
# fmt: off
df.loc[:, self.RESNAME] = 0 # set all urineoutput_stage values to 0
df.loc[:, self.RESNAME] = np.nan # set all urineoutput_stage values to NaN
df.loc[df.rolling(6).min()[self._column] >= 0, self.RESNAME] = 0

if self._method == UrineOutputMethod.STRICT:
df.loc[(df.rolling(6).max()[self._column] / weight) < 0.5, self.RESNAME] = 1
df.loc[(df.rolling(12).max()[self._column] / weight) < 0.5, self.RESNAME] = 2
Expand Down
Loading

0 comments on commit f33beb6

Please sign in to comment.