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

Specify input dtypes for the statistical functions #234

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

asmeurer
Copy link
Member

Functions like mean() that perform divisions require floating-point inputs.
All other functions require numeric inputs.

This was mentioned in #232 but does not fix the main question of that issue
(the behavior of the statistical functions on empty arrays). I can implement
that as well if we come to an agreement about what it should say.

Functions like mean() that perform divisions require floating-point inputs.
All other functions require numeric inputs.

This was mentioned in data-apis#232 but does not fix the main question of that issue
(the behavior of the statistical functions on empty arrays). I can implement
that as well if we come to an agreement about what it should say.
@kgryte
Copy link
Contributor

kgryte commented Jul 22, 2021

Not convinced that the input dtypes for mean, median, std, or variance should be restricted to only floating-point. The output dtype, as already specified for mean, std, variance is floating-point. Meaning, how libraries choose to cast/promote internally should be implementation-defined.

@asmeurer
Copy link
Member Author

Happy to change it to numeric. I was basing it off the elementwise functions, which only require floating-point input when the output type has to be floating-point.

@kgryte
Copy link
Contributor

kgryte commented Jul 22, 2021

@asmeurer Yeah, that is true. In which case, having as floating-point makes sense. Punts the responsibility to userland to figure out casting/promotion, which was the rationale behind the element-wise transcendentals.

Copy link
Contributor

@kgryte kgryte left a comment

Choose a reason for hiding this comment

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

LGTM.

@kgryte kgryte merged commit b134073 into data-apis:main Sep 13, 2021
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