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

Overload mean to take a function alongwith a dimension #31576

Merged
merged 12 commits into from
Apr 16, 2019

Conversation

eulerkochy
Copy link
Contributor

Fixes #31412

stdlib/Statistics/src/Statistics.jl Outdated Show resolved Hide resolved
stdlib/Statistics/src/Statistics.jl Outdated Show resolved Hide resolved
stdlib/Statistics/test/runtests.jl Outdated Show resolved Hide resolved
stdlib/Statistics/src/Statistics.jl Outdated Show resolved Hide resolved
@stevengj
Copy link
Member

stevengj commented Apr 6, 2019

Another issue here is that sum allows dims to contain the same dimension more than once, e.g. you can do dim=(1,1), but in this case you will be dividing by the wrong number of elements and silently give the wrong answer.

@eulerkochy
Copy link
Contributor Author

Another issue here is that sum allows dims to contain the same dimension more than once, e.g. you can do dim=(1,1), but in this case you will be dividing by the wrong number of elements and silently give the wrong answer.

Can't we modify the dims to allow only unique dimensions?

@eulerkochy
Copy link
Contributor Author

@stevengj does this look fine now?

@ararslan ararslan added statistics The Statistics stdlib module needs news A NEWS entry is required for this change labels Apr 11, 2019
@eulerkochy
Copy link
Contributor Author

@ararslan is it fine now?

NEWS.md Outdated Show resolved Hide resolved
Co-Authored-By: eulerkochy <kc99.kol@gmail.com>
@ararslan ararslan removed the needs news A NEWS entry is required for this change label Apr 14, 2019
@ararslan ararslan merged commit 4f59976 into JuliaLang:master Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
statistics The Statistics stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing mean(f, x; dims) method
5 participants