1- using Compat . Statistics
1+ import StatsBase
22
33function fill_refs! (refs:: AbstractArray , X:: AbstractArray ,
44 breaks:: AbstractVector , extend:: Bool , allow_missing:: Bool )
@@ -166,7 +166,7 @@ function cut(x::AbstractArray{T, N}, breaks::AbstractVector;
166166end
167167
168168"""
169- cut(x::AbstractArray, ngroups::Integer;
169+ cut(x::AbstractArray, [w::AbstractWeights, ] ngroups::Integer;
170170 labels::Union{AbstractVector{<:AbstractString},Function})
171171
172172Cut a numeric array into `ngroups` quantiles, determined using
@@ -175,3 +175,7 @@ Cut a numeric array into `ngroups` quantiles, determined using
175175cut (x:: AbstractArray , ngroups:: Integer ;
176176 labels:: Union{AbstractVector{<:AbstractString},Function} = default_formatter) =
177177 cut (x, Statistics. quantile (x, (1 : ngroups- 1 )/ ngroups); extend= true , labels= labels)
178+
179+ cut (x:: AbstractArray , w:: AbstractWeights , ngroups:: Integer ;
180+ labels:: Union{AbstractVector{<:AbstractString},Function} = default_formatter) =
181+ cut (x, StatsBase. quantile (x, w, (1 : ngroups- 1 )/ ngroups); extend= true , labels= labels)
0 commit comments