1
- using Compat . Statistics
1
+ import StatsBase
2
2
3
3
function fill_refs! (refs:: AbstractArray , X:: AbstractArray ,
4
4
breaks:: AbstractVector , extend:: Bool , allow_missing:: Bool )
@@ -166,7 +166,7 @@ function cut(x::AbstractArray{T, N}, breaks::AbstractVector;
166
166
end
167
167
168
168
"""
169
- cut(x::AbstractArray, ngroups::Integer;
169
+ cut(x::AbstractArray, [w::AbstractWeights, ] ngroups::Integer;
170
170
labels::Union{AbstractVector{<:AbstractString},Function})
171
171
172
172
Cut a numeric array into `ngroups` quantiles, determined using
@@ -175,3 +175,7 @@ Cut a numeric array into `ngroups` quantiles, determined using
175
175
cut (x:: AbstractArray , ngroups:: Integer ;
176
176
labels:: Union{AbstractVector{<:AbstractString},Function} = default_formatter) =
177
177
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