Open meggart opened 6 years ago
Thanks for the report. It seems logical to expect that the array and its weights have the same shape; else the correspondence between an element and its weight wouldn't be clear. The error message could be improved, though, and weights should probably accept any kind of array, not just vectors (they have recently been renamed from WeightsVec
to Weights
). Can you file an issue/PR against StatsBase?
I am on julia 0.6. Currently the following results in a stack overflow:
because this code https://github.com/JuliaStats/DataArrays.jl/blob/8b9e89617ca3539440a9a1b2fc75fc44f86ec850/src/reduce.jl#L178-L185 seems to assume that both the DataArray and the weight vector are of the same shape. However, it does not seem possible to create a
Weights
Vector with some shape information.I would be happy to provide a PR with a fix, but wanted to ask before if this behavior is intended in some way...