Skip to content

Add a correction keyword to the std methods #183

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

Merged
merged 4 commits into from
Jul 5, 2023

Conversation

MarcoGorelli
Copy link
Contributor

closes #170

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks Marco. LGTM modulo my minor type annotation comment.

@MarcoGorelli MarcoGorelli requested a review from rgommers June 21, 2023 13:35
Comment on lines 481 to 483
correction
Correction to apply to the result. 0 for sample standard deviation
and 1 for population standard deviation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we're only supporting 0 or 1 can this just be an int for now? We could change to allow floats later if desired?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the description is misleading here. The 0 and 1 references are, tmk, to help users identify common correction values. See the Array API specification for a more extensive description.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we "borrow" the docstring from the Array API specification then?

Copy link
Contributor

Choose a reason for hiding this comment

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

Fine with me, but up to Marco. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've reworded to make clear that 0 and 1 are just examples

Copy link
Member

Choose a reason for hiding this comment

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

That rewording was for only 1 of 4 docstrings. I now edited all of them, and for one adopted the more extensive description from the array API standard.

Copy link
Member

Choose a reason for hiding this comment

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

@MarcoGorelli if you're happy with that change, I think this PR is good to go.

@rgommers rgommers changed the title Add correction to std Add a correction keyword to the std methods Jul 5, 2023
@rgommers
Copy link
Member

rgommers commented Jul 5, 2023

Also a note on the default: that is 1 (which matches Pandas) rather than 0 (which matches the array API standard and numpy). This seems fine to me, just pointing it out for future reference.

@MarcoGorelli
Copy link
Contributor Author

much appreciated, nice improvement - thanks!

@MarcoGorelli MarcoGorelli merged commit ed70c67 into data-apis:main Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std / var : ddof?
4 participants