Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/awkward/operations/ak_moment.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def moment(

Passing all arguments to the reducers, the moment is calculated as

ak.sum((x*weight)**n) / ak.sum(weight)
ak.sum(x**n * weight) / ak.sum(weight)

The `n=2` moment differs from #ak.var in that #ak.var also subtracts the
mean (the `n=1` moment).
Expand Down Expand Up @@ -148,7 +148,7 @@ def _impl(
attrs=ctx.attrs,
)
sumwxn = ak.operations.ak_sum._impl(
(x * weight) ** n,
(x**n) * weight,
axis,
keepdims,
mask_identity,
Expand Down
Loading