Histogram fails with skipmissing
julia> using StatsBase
julia> fit(Histogram, [1, 1, 2])
Histogram{Int64,1,Tuple{StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}}}
edges:
1.0:0.5:2.5
weights: [2, 0, 1]
closed: left
isdensity: false
julia> fit(Histogram, skipmissing([1, 1, 2]))
ERROR: MethodError: no method matching fit(::Type{Histogram{Int64,N,E} where E where N}, ::Base.SkipMissing{Array{Int64,1}})
There is nothing about fitting a histogram that requires the array interface.
If there is a concern about working with weights, there is skipmissings in Missings.jl which allows you to sync up iterators with missing values.
Could be actually a good moment to look at this, as https://github.com/JuliaStats/StatsBase.jl/pull/605 is fixed now.
On master, I still get the same error.
julia> fit(Histogram, skipmissing([1, 2, 3]))
ERROR: MethodError: no method matching fit(::Type{Histogram{Int64,N,E} where E where N}, ::Base.SkipMissing{Array{Int64,1}})
I'm optimistic about making this work by removing some AbstractVector type annotations though. A quick search of the code doesn't reveal any length calls for the underlying data.
Okay update length is called to calculate the optimal number of bins in the beginning. But after that things seem good.