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

Std axis #486

Closed
wants to merge 42 commits into from
Closed

Std axis #486

wants to merge 42 commits into from

Conversation

LukeMathWalker
Copy link
Member

Adding a std_axis method to compute the standard deviation along an axis. Following up on rust-ndarray/ndarray-stats#1

LukeMathWalker and others added 30 commits April 19, 2018 07:51
…to avoid panicking if length of axis is equal to 1. Added panic if ddof is greater or equal than the length of the variance axis.
…to avoid panicking if length of axis is equal to 1. Added panic if ddof is greater or equal than the length of the variance axis.
Copy link
Member

@jturner314 jturner314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me, although ideally we'd use .mapv_into instead of .mapv (see the comment). Will you please make that change?

A: Float,
D: RemoveAxis,
{
self.var_axis(axis, ddof).mapv(|x| x.sqrt())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change the .mapv into .mapv_into to avoid the extra allocation.

@LukeMathWalker
Copy link
Member Author

Done @jturner314

jturner314 added a commit to jturner314/ndarray that referenced this pull request Sep 19, 2018
@jturner314
Copy link
Member

I merged this PR. I squashed all the commits and fixed some minor whitespace issues. Unfortunately, GitHub doesn't understand that I merged this PR, so I have to manually close it.

Thanks @LukeMathWalker!

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

Successfully merging this pull request may close these issues.

2 participants