JuliaStats / StatsBase.jl

Basic statistics for Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

counts should accept AbstractUnitRange as levels argument

fredcallaway opened this issue · comments

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