Skip to content

Commit

Permalink
Rename Series output to 'mean' in analysis utils (#1571)
Browse files Browse the repository at this point in the history
Previously, only DataFrame outputs had their columns renamed to 'mean.' This update ensures consistency by renaming Series outputs to 'mean' as well. It improves clarity and aligns with the expected nomenclature.
  • Loading branch information
tbhallett authored Jan 16, 2025
1 parent 4f161e3 commit ed8a131
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tlo/analysis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ def summarize(
if isinstance(output, pd.DataFrame):
output = output.rename(columns={'central': 'mean'},
level=0 if output.columns.nlevels == 1 else 1)
else:
output.name = 'mean' # rename the series to mean

return output


Expand Down

0 comments on commit ed8a131

Please sign in to comment.