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

Frame(range) may produce wrong result, rarely #1942

Closed
st-pasha opened this issue Jul 31, 2019 · 0 comments · Fixed by #1943
Closed

Frame(range) may produce wrong result, rarely #1942

st-pasha opened this issue Jul 31, 2019 · 0 comments · Fixed by #1943
Assignees
Labels
bug Any bugs / errors in datatable; however for severe bugs use [segfault] label low priority Low priority tasks

Comments

@st-pasha
Copy link
Contributor

In some degenerate cases datatable miscalculates the number of elements in a range, returning a 1-row Frame instead of 0-row.

>>> dt.Frame(range(2, 2, 2)).to_list()
[[2]]
>>> list(range(2, 2, 2))
[]
@st-pasha st-pasha added bug Any bugs / errors in datatable; however for severe bugs use [segfault] label low priority Low priority tasks labels Jul 31, 2019
@st-pasha st-pasha added this to the Release 0.10.0 milestone Jul 31, 2019
@st-pasha st-pasha self-assigned this Jul 31, 2019
st-pasha added a commit that referenced this issue Jul 31, 2019
The length of range object was incorrectly interpreted when `start-step < stop <= start`. This was due to C division rules for negative numbers different from Python rules.

In addition, `Column::make_range()` was moved to `OColumn` class.

Closes #1942
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 low priority Low priority tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant