h2oai / h2oai/datatable

Incorrect output for nested reducers

Open
#3,417 4 comments 0 reactions 1 assignee Claimed by @oleksiyskononenko View on GitHub
bug groupby
Dominant language
C++
Stars
1.9k
Forks
164
Avg merge
7h 31m
Merged PRs (30d)
1

Description

Nesting aggregation calls sometimes produces incorrect results

```py
>>> 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
```py
>>> 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.