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

counts should accept AbstractUnitRange as levels argument #908

Open
fredcallaway opened this issue Dec 22, 2023 · 0 comments
Open

counts should accept AbstractUnitRange as levels argument #908

fredcallaway opened this issue Dec 22, 2023 · 0 comments

Comments

@fredcallaway
Copy link
Contributor

Currently it only takes UnitRange, thus this doesn't work:

counts([1,1,2,3,], Base.OneTo(5))
ERROR: DimensionMismatch: all inputs to eachindex must have the same indices, got Base.OneTo(4) and Base.OneTo(5)

Worse than that, this "works" but gives an unexpected result

counts([1,1,2,3,], Base.OneTo(4))
3×4 Matrix{Int64}:
 1  1  0  0
 0  0  1  0
 0  0  0  1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant