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

Stop catching TypeError in groupby methods #29060

Merged
merged 12 commits into from
Oct 17, 2019

Conversation

jbrockmendel
Copy link
Member

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.

Copy link
Contributor

@jreback jreback left a 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":
Copy link
Contributor

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)

Copy link
Member Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

great

@jbrockmendel
Copy link
Member Author

don't we need to have tests for the complex path ?

we have a couple of tests that get here with an ndarray[object] containing complex objects

@jreback jreback added this to the 1.0 milestone Oct 17, 2019
@jreback jreback merged commit 6d35836 into pandas-dev:master Oct 17, 2019
@jreback
Copy link
Contributor

jreback commented Oct 17, 2019

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the faster_complex branch October 17, 2019 22:55
HawkinsBA pushed a commit to HawkinsBA/pandas that referenced this pull request Oct 29, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
bongolegend pushed a commit to bongolegend/pandas that referenced this pull request Jan 1, 2020
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.

2 participants