-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
PERF: fail-fast in object-dtype mean #62280
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
Conversation
| >>> nanops.nanmean(s.values) | ||
| np.float64(1.5) | ||
| """ | ||
| if values.dtype == object and len(values) > 1_000 and mask is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just not infer_dtype(values) for object dtype to raise early if the inferred type are strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- infer_dtype is a pattern im trying to move us away from, 2) that would still require a full pass through the data, 3) that would for strings but not hypothetical other cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK sure thing. Should the 5 below then match the 1000 above then for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will update
|
Thanks @jbrockmendel |
meanmethod works too long with object type #54754 (Replace xxxx with the GitHub issue number)doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.@mroeschke might have an opinion on a better place to put the hard-coded (completely arbitrary)
1_000value.