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

Histogram lo/hi limits #1146

Closed
Poshi opened this issue Dec 14, 2022 · 1 comment
Closed

Histogram lo/hi limits #1146

Poshi opened this issue Dec 14, 2022 · 1 comment
Assignees
Labels

Comments

@Poshi
Copy link
Contributor

Poshi commented Dec 14, 2022

There are some issues when using manual limits on the histogram command. When using the automatic range selection, everything seems to go well:

$ mlr --pprint --from /tmp/tmp.bNq5vP0GAY histogram --auto --nbins 10 -f count
bin_lo  bin_hi  count_count
1       1766.3  1030
1766.3  3531.6  504
3531.6  5296.9  260
5296.9  7062.2  116
7062.2  8827.5  54
8827.5  10592.8 23
10592.8 12358.1 6
12358.1 14123.4 4
14123.4 15888.7 2
15888.7 17654   2

But when using manual range selection, the range (and output) is not the expected:

$ mlr --pprint --from /tmp/tmp.bNq5vP0GAY histogram --lo 1 --hi 17654 --nbins 10 -f count
bin_lo  bin_hi  count_count
1765.3  3530.6  1030
3530.6  5295.9  504
5295.9  7061.2  260
7061.2  8826.5  116
8826.5  10591.8 54
10591.8 12357.1 23
12357.1 14122.4 6
14122.4 15887.7 4
15887.7 17653   2
17653   19418.3 2

Lowest value for count is 1 and highest is 17654, so --auto seems to get it right. I used this test data.

Version is 6.5.0:

$ mlr --version
mlr 6.5.0
@johnkerl
Copy link
Owner

Sadly, this was more of #1089 -- there was a bug (same bug) in the auto and non-auto cases and in #1089 I fixed only one of the two. :(

Also, unit tests for non-auto had --lo 0 which doesn't surface the bug.

On #1157 I've addressed both issues.

Very sorry about the failures!

@johnkerl johnkerl removed the active label Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants