Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method for weighted mean with mismatched types is gone #475

Closed
ararslan opened this issue Mar 4, 2019 · 3 comments
Closed

Method for weighted mean with mismatched types is gone #475

ararslan opened this issue Mar 4, 2019 · 3 comments

Comments

@ararslan
Copy link
Member

ararslan commented Mar 4, 2019

The fallback treats the first argument as a function apparently??

julia> mean(Union{Int,Missing}[1,2,3], weights([1,2,3]))
4.666666666666667

julia> @which mean(Union{Int,Missing}[1,2,3], weights([1,2,3]))
mean(f, A::AbstractArray) in Statistics at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Statistics/src/Statistics.jl:76
@omus
Copy link

omus commented Mar 4, 2019

Would it also make sense to make mean(f, A::AbstractArray) be mean(f::Base.Callable, A::AbstractArray)?

@ararslan
Copy link
Member Author

ararslan commented Mar 4, 2019

It would, but that method is defined in Statistics rather than StatsBase.

@omus
Copy link

omus commented Mar 4, 2019

The PR that removed Callable: JuliaLang/julia#29692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants