-
Notifications
You must be signed in to change notification settings - Fork 195
Closed
Labels
Description
I think this code should work:
julia> using StatsBase
julia> sample(1:3, StatsBase.Weights(rand(Float32,3)), replace=true)
ERROR: MethodError: no method matching sample(::UnitRange{Int64}, ::Weights{Float32, Float32, Vector{Float32}}; replace=true)
Closest candidates are:
sample(::AbstractArray, ::AbstractWeights) at /home/juliohm/.julia/packages/StatsBase/DU1bT/src/sampling.jl:561 got unsupported keyword argument "replace"
sample(::AbstractArray, ::AbstractWeights, ::Integer; replace, ordered) at /home/juliohm/.julia/packages/StatsBase/DU1bT/src/sampling.jl:932
sample(::AbstractArray, ::AbstractWeights, ::Tuple{Vararg{Int64, N}} where N; replace, ordered) at /home/juliohm/.julia/packages/StatsBase/DU1bT/src/sampling.jl:939
It works fine with Float64.