-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed as not planned
Labels
duplicateIndicates similar issues or pull requestsIndicates similar issues or pull requestsfoldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.
Description
The generic fallback for mean
can give wrong results in some cases. Maybe it would be a good idea to add a specialized implementation when it is called on a SkipMissing
, as there is for sum
. The easiest way to do this would be to pass a function that computes both sum
and count
to mapreduce
.
A = rand(Float32, 1_000_000) .+ 1f6
mean(skipmissing(A)) ≈ mean(A) # false
mean(A) ≈ (sum(skipmissing(A)) / length(A)) # true
Related: #30421
Metadata
Metadata
Assignees
Labels
duplicateIndicates similar issues or pull requestsIndicates similar issues or pull requestsfoldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.