Skip to content

Commit

Permalink
lm: predict() does not always return pd.Series
Browse files Browse the repository at this point in the history
  • Loading branch information
EvaJanouskova committed Oct 7, 2024
1 parent 44ac319 commit 3464e3e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/tlo/lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ def predict(
# pop the boolean out of the series if we have a single row,
# otherwise return the series
if len(outcome) == 1 and squeeze_single_row_output:
assert isinstance(outcome.iloc[0], pd.Series)
return outcome.iloc[0]
else:
return outcome
Expand Down

0 comments on commit 3464e3e

Please sign in to comment.