From 5ab623eab1f08100e20d89841aca23a434ffbd01 Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Thu, 3 Dec 2020 17:45:15 +0100 Subject: [PATCH] Document that addcounts supports weights The method exists but it wasn't mentioned. --- src/counts.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/counts.jl b/src/counts.jl index 3278fce9d..21793a5f2 100644 --- a/src/counts.jl +++ b/src/counts.jl @@ -389,9 +389,10 @@ end """ countmap(x; alg = :auto) + countmap(x::AbstractVector, w::AbstractVector{<:Real}; alg = :auto) Return a dictionary mapping each unique value in `x` to its number -of occurrences. +of occurrences. A vector of weights `w` can be provided when `x` is a vector. - `:auto` (default): if `StatsBase.radixsort_safe(eltype(x)) == true` then use `:radixsort`, otherwise use `:dict`.