Skip to content

Histogram fails with skipmissing #615

@pdeffebach

Description

@pdeffebach
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions