Skip to content

Commit

Permalink
Small opt
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Jun 30, 2024
1 parent b63a20b commit da8fb41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flox/aggregate_npg.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _var_std_wrapper(group_idx, array, engine, *, axis=-1, **kwargs):
# https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
# Cast any unsigned types first
dtype = np.result_type(array, np.int8(-1) * array[0])
array = array.astype(dtype)
array = array.astype(dtype, copy=False)
first = _get_aggregate(engine).aggregate(group_idx, array, func="nanfirst", axis=axis)
array = array - first[..., group_idx]
return _get_aggregate(engine).aggregate(group_idx, array, axis=axis, **kwargs)
Expand Down

0 comments on commit da8fb41

Please sign in to comment.