-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Stop catching TypeError in groupby methods #29060
Conversation
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.
don't we need to have tests for the complex path ?
try: | ||
values = ensure_float64(values) | ||
except TypeError: | ||
if lib.infer_dtype(values, skipna=False) == "complex": |
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.
future PR should push this to pandas/core/dtypes/cast.py and just call here (maybe make ensure_float64_or_complex)
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.
yah. i think there was some discussion of a one-pass variant of lib.infer_dtype that would go well with that
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.
great
we have a couple of tests that get here with an ndarray[object] containing complex objects |
thanks @jbrockmendel |
cc @WillAyd @jreback
Note this doesn't touch cython_agg_blocks, I've run out of things to meddle with there.
Open to suggestions for the DecimalArray case.