Skip to content

Allow numeric Vectors as weights #335

@xiaodaigh

Description

@xiaodaigh

When I first started using countmap I was confused about how to do a count with weights. I thought countmap(x, wgt) would do where wgt is a numeric vector. But actually we need countmap(x, weights(wgt)).

When I looked into the documentation there are 3 types of weights: they are Analytical, Frequency and Probability; these seem to be useful. But before reading the source code I only thought of weights as a numeric weight for each value and I suspect a lot of people would think like that too.

So do you think it's ok to add this signature?
countmap(Vector{T}, Vectr{S}) where {T, S<:Number}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions