Skip to content

CLN: MultiIndex.get_value is a hive of scum and villainy #31662

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 14 commits into from
Feb 5, 2020

Conversation

jbrockmendel
Copy link
Member

This will in turn allow for simplification for other code that has built up kludges around MultiIndex.get_value's behavior

@@ -405,7 +405,7 @@ def test_agg_misc():
]

# passed lambda
for t in cases:
for i, t in enumerate(cases):
Copy link
Member

Choose a reason for hiding this comment

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

Why? Where is this i used?

Copy link
Member Author

Choose a reason for hiding this comment

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

this was in debugging, thought i had reverted it, thanks for pointing it out

# We allow tuples if they are hashable, whereas other Index
# subclasses require scalar.
# We have to explicitly exclude generators, as these are hashable.
raise InvalidIndexError(key)

def _try_mi(k):
Copy link
Contributor

Choose a reason for hiding this comment

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

should think about making try_mi non-nested (just for cleanliness), give it a better name and type in the future.

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 there's plenty more to do here, but this is a big step

@jreback jreback added Clean Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex labels Feb 5, 2020
@jreback jreback added this to the 1.1 milestone Feb 5, 2020
@jreback jreback merged commit a1e0752 into pandas-dev:master Feb 5, 2020
@jbrockmendel jbrockmendel deleted the mi-indexing branch February 5, 2020 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants