Skip to content

MultiIndex union/intersection with non-object other #32646

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

Merged
merged 5 commits into from
Mar 17, 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

ATM if we call MultiIndex.union with e.g. a Float64Index, we get ValueError: Buffer dtype mismatch, expected 'Python object' but got 'double' from lib.fast_unique_multiple. This PR changes that to raise NotImplementedError with a reasonable message, but we could alternatively return self.to_flat_index().union(other)

I prefer making the user do to_flat_index on their own because this seems like something that would often be reached by accident.

@jreback jreback added MultiIndex Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Mar 12, 2020
[self._values, other._ndarray_values], sort=sort
)
if not is_object_dtype(other.dtype):
raise NotImplementedError(
Copy link
Contributor

Choose a reason for hiding this comment

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

is this hit in any tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, can add one

Copy link
Contributor

Choose a reason for hiding this comment

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

can you add one

Copy link
Member Author

Choose a reason for hiding this comment

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

added+green (though no azure)

@jbrockmendel
Copy link
Member Author

gentle ping; we're on the verge of being rid of _ndarray_values

@jreback jreback added this to the 1.1 milestone Mar 17, 2020
@jreback jreback merged commit 96d22d4 into pandas-dev:master Mar 17, 2020
@jreback
Copy link
Contributor

jreback commented Mar 17, 2020

thanks

@jbrockmendel jbrockmendel deleted the no-ndarray_values-mi branch March 17, 2020 01:39
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MultiIndex Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants