Skip to content

Commit

Permalink
Switch to numerical stable algorithms for var and cov in Ibis
Browse files Browse the repository at this point in the history
  • Loading branch information
e10v committed Jan 28, 2024
1 parent 627d3bd commit bb96429
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tea_tasting/aggr.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ def read_aggregates(
_DEMEAN.format(col): data[col] - data[col].mean() # type: ignore
for col in demean_cols
}
data = data.mutate(**demean_expr)
grouped_data = data.group_by(group_col) if group_col is not None else data
data = grouped_data.mutate(**demean_expr)

count_expr = {_COUNT: data.count()} if has_count else {}
mean_expr = {_MEAN.format(col): data[col].mean() for col in mean_cols} # type: ignore
Expand Down

0 comments on commit bb96429

Please sign in to comment.