Skip to content

Commit ed8a131

Browse files
authored
Rename Series output to 'mean' in analysis utils (#1571)
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.
1 parent 4f161e3 commit ed8a131

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/tlo/analysis/utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,9 @@ def summarize(
471471
if isinstance(output, pd.DataFrame):
472472
output = output.rename(columns={'central': 'mean'},
473473
level=0 if output.columns.nlevels == 1 else 1)
474+
else:
475+
output.name = 'mean' # rename the series to mean
476+
474477
return output
475478

476479

0 commit comments

Comments
 (0)