Incorrect output for nested reducers

Open
#3,417 4 comments 0 reactions 1 assignee View on GitHub

@oleksiyskononenko is already working on this.

Since Mar 21, 2023.

Assessment

This issue has not been assessed yet.

Description

bug groupby

Nesting aggregation calls sometimes produces incorrect results

>>> from datatable import dt, f
>>> DT = dt.Frame([1, 2])
>>> DT[:, dt.mean(dt.sum(f.C0))]
   |         C0
   |    float64
-- + ----------
 0 | 2.8823e+18
[1 row x 1 column]
>>> DT[:, dt.sum(dt.mean(f.C0))]
   |          C0
   |     float64
-- + -----------
 0 | 2.31584e+77
[1 row x 1 column]

The expected behavior is

>>> DT[:, dt.mean(dt.sum(f.C0))]
   |    C0
   | float64
-- + -----
 0 |     3
[1 row x 1 column]
>>> DT[:, dt.sum(dt.mean(f.C0))]
   |      C0
   | float64
-- + -------
 0 |     1.5
[1 row x 1 column]

datatable version: 1.1
python version: 3.9
operating system: linux

Dominant language
C++
Stars
1.9k
Forks
164
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from h2oai/datatable

All issues in h2oai/datatable

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.