Skip to content

REF: de-duplicate _wrap_joined_index in MultiIndex #36313

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 36 commits into from
Sep 13, 2020

Conversation

jbrockmendel
Copy link
Member

Follow-up to #36282

We'll also be able to clean up MultiIndex special-casing in _reindex_non_unique. I expect others but cant say for sure yet.

jbrockmendel and others added 30 commits August 20, 2020 21:19
@jreback jreback added MultiIndex Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Sep 12, 2020
@jreback jreback added this to the 1.2 milestone Sep 12, 2020
if isinstance(self, ABCMultiIndex):
name = self.names if self.names == other.names else None
else:
name = get_op_result_name(self, other)
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm why can't we do this in get_op_result_name?

Copy link
Member Author

Choose a reason for hiding this comment

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

i considered that, decided against it because it meant additional overhead in a lot of places

Copy link
Contributor

Choose a reason for hiding this comment

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

kk

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.

assume you are going to use names_compat in more places

if isinstance(self, ABCMultiIndex):
name = self.names if self.names == other.names else None
else:
name = get_op_result_name(self, other)
Copy link
Contributor

Choose a reason for hiding this comment

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

kk

@@ -152,6 +153,25 @@ def _codes_to_ints(self, codes):
return np.bitwise_or.reduce(codes, axis=1)


def names_compat(meth):
Copy link
Contributor

Choose a reason for hiding this comment

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

type if you can

@jreback jreback merged commit 23e28df into pandas-dev:master Sep 13, 2020
@jbrockmendel jbrockmendel deleted the compat-mi-names branch September 13, 2020 15:03
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 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.

4 participants