Skip to content

Commit

Permalink
Fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan committed Dec 27, 2024
1 parent 4c691ab commit 919743c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ function cut(x::AbstractArray, ngroups::Integer;
min_x, max_x = extrema(xnm)
breaks = [min_x; breaks; max_x]
if !allowempty && !allunique(@view breaks[1:end-1])
n = length(unique(breaks))
n = length(unique(breaks)) - 1
throw(ArgumentError("cannot compute $ngroups quantiles: `quantile` " *
"returned only $n group(s) due to duplicated values in `x`." *
"returned only $n group(s) due to duplicated values in `x`. " *
"Pass `allowempty=true` to allow empty quantiles or " *
"choose a lower value for `ngroups`."))
end
Expand Down

0 comments on commit 919743c

Please sign in to comment.