Skip to content

Commit 217da39

Browse files
authored
Document that addcounts supports weights (#623)
The method exists but it wasn't mentioned.
1 parent 0ba8a95 commit 217da39

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/counts.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,10 @@ end
389389

390390
"""
391391
countmap(x; alg = :auto)
392+
countmap(x::AbstractVector, w::AbstractVector{<:Real}; alg = :auto)
392393
393394
Return a dictionary mapping each unique value in `x` to its number
394-
of occurrences.
395+
of occurrences. A vector of weights `w` can be provided when `x` is a vector.
395396
396397
- `:auto` (default): if `StatsBase.radixsort_safe(eltype(x)) == true` then use
397398
`:radixsort`, otherwise use `:dict`.

0 commit comments

Comments
 (0)