julia> using StatsBase
julia> fit(Histogram, [1 for _ in 1:1000])
Histogram{Int64,1,Tuple{StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}}}
edges:
1.0:1.0:2.0
weights: [1000]
closed: left
isdensity: false
julia> fit(Histogram, [1.234 for _ in 1:1000])
Histogram{Int64,1,Tuple{StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}}}
edges:
2.234:2.0:4.234
weights: [0]
closed: left
isdensity: false
Fitting a histogram to all-equal integer values works, but not for all-equal float values – see the 0 weight in the second example. The bin edges seem to be computed incorrectly?