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

BUG: Index.intersection casting to object instead of numeric #38122

Merged
merged 2 commits into from
Nov 29, 2020

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions Index Related to the Index class or subclasses labels Nov 29, 2020
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.

lgtm pls add a whatsnew note (1.2 fine)

this = self.astype("O")
other = other.astype("O")
dtype = find_common_type([self.dtype, other.dtype])
this = self.astype(dtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

prob nbd but can do copy=False

@jreback jreback added this to the 1.2 milestone Nov 29, 2020
@jbrockmendel
Copy link
Member Author

already has whatsnew. mind if i add the copy=False in the next pass? lots in the pipeline

@jreback
Copy link
Contributor

jreback commented Nov 29, 2020

already has whatsnew. mind if i add the copy=False in the next pass? lots in the pipeline

sure

@jreback jreback merged commit 1cb5f69 into pandas-dev:master Nov 29, 2020
@jbrockmendel jbrockmendel deleted the bug-setops-43 branch November 29, 2020 18:27
@jorisvandenbossche
Copy link
Member

I don't know if it was this PR (from this range 65319af...f04ec86), but the intersection method got a bit slowdown in case of numeric indexes: https://pandas.pydata.org/speed/pandas/#index_object.SetOperations.time_operation?p-dtype='int'&p-method='intersection'

@jorisvandenbossche
Copy link
Member

Ah, might also be #36927

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Index Related to the Index class or subclasses
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants