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

stdm with dims arg is missing #12

Closed
denizyuret opened this issue Sep 16, 2019 · 4 comments
Closed

stdm with dims arg is missing #12

denizyuret opened this issue Sep 16, 2019 · 4 comments

Comments

@denizyuret
Copy link

https://github.com/JuliaLang/julia/blob/2f426e45c24e0d94c11f503aa696a902f1bb6aed/stdlib/Statistics/src/Statistics.jl#L381 should also have a dims keyword argument.

@nalimilan
Copy link
Member

You can use the mean argument to std. stdm is basically deprecated, except that we can't do that before 2.0. The docstring should probably point to std.

@denizyuret
Copy link
Author

Currently the mean argument has a problem: https://github.com/JuliaLang/julia/blob/2f426e45c24e0d94c11f503aa696a902f1bb6aed/stdlib/Statistics/src/Statistics.jl#L338 uses something(mean, Statistics.mean(A, dims=dims)) which ends up calculating the mean whether or not the user provides one (both args are evaluated afaik). Typically people would use the mean option not to calculate the mean twice.

@nalimilan
Copy link
Member

Indeed, good catch. Fortunately that's easy to fix, just replace this with an if mean === nothing block. Would you make a pull request?

@fredrikekre fredrikekre transferred this issue from JuliaLang/julia Nov 29, 2019
knuesel added a commit to knuesel/Statistics.jl that referenced this issue Jan 20, 2021
knuesel added a commit to knuesel/Statistics.jl that referenced this issue Jan 20, 2021
@nalimilan
Copy link
Member

Fixed by #68.

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