Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect result when groupby is applied to a view #1542

Closed
st-pasha opened this issue Jan 13, 2019 · 0 comments · Fixed by #1545
Closed

Incorrect result when groupby is applied to a view #1542

st-pasha opened this issue Jan 13, 2019 · 0 comments · Fixed by #1545
Assignees
Labels
bug Any bugs / errors in datatable; however for severe bugs use [segfault] label DT[i,j,...] Issues related to evaluation of the primary expression `DT[i, j, ...]` groupby Group-by functionality and Reducers views Issues that are specific to "view" frames only
Milestone

Comments

@st-pasha
Copy link
Contributor

>>> from datatable import *
>>> DT = Frame(a=[1,2,3,1,2,3], b=[3,6,2,4,3,1], c=list("bdbbdb"))
>>> DT[f.a != 1, :]
      a   b  c 
---  --  --  --
 0    2   6  d 
 1    3   2  b 
 2    2   3  d 
 3    3   1  b 

[4 rows x 3 columns]

>>> DT[f.a != 1, :][:, max(f.b), by(f.c)]
     c   C0
---  --  --
 0   d    3
 1   b    3

[2 rows x 2 columns]
@st-pasha st-pasha added bug Any bugs / errors in datatable; however for severe bugs use [segfault] label views Issues that are specific to "view" frames only groupby Group-by functionality and Reducers DT[i,j,...] Issues related to evaluation of the primary expression `DT[i, j, ...]` labels Jan 13, 2019
@st-pasha st-pasha added this to the Release 0.8.0 milestone Jan 13, 2019
@st-pasha st-pasha self-assigned this Jan 13, 2019
st-pasha added a commit that referenced this issue Jan 14, 2019
Added new internal method `DataTable::group(spec, as_view) -> pair<RowIndex, Groupby>`, as a replacement for `DataTable::sortby()`. The new method has more predictable return value: the returned rowindex either applies to the column, or to its source (for a view column), depending on the value of the parameter `as_view`.

Closes #1542
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Any bugs / errors in datatable; however for severe bugs use [segfault] label DT[i,j,...] Issues related to evaluation of the primary expression `DT[i, j, ...]` groupby Group-by functionality and Reducers views Issues that are specific to "view" frames only
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant