Skip to content

Conversation

@jbrockmendel
Copy link
Member

No description provided.

Comment on lines +2493 to +2494
if dropna and not isinstance(self, ABCMultiIndex):
# isna not defined for MultiIndex
Copy link
Contributor

Choose a reason for hiding this comment

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

It is reasonable to consider that ABCMultiIndex is never going to have isna defined?

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 came up on a dev call earlier this year and it didn't sound like there was reason for optimism.

Copy link
Contributor

Choose a reason for hiding this comment

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

isna is tricky because a MI can be multi-valued e.g does isna refer to any value on a level, or all levels be null? it would be reasonable to actually return a multi-value here (e.g. same shape as the MI), but would need to see the implications if this is done.

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.

some followon suggestions

Comment on lines +2493 to +2494
if dropna and not isinstance(self, ABCMultiIndex):
# isna not defined for MultiIndex
Copy link
Contributor

Choose a reason for hiding this comment

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

isna is tricky because a MI can be multi-valued e.g does isna refer to any value on a level, or all levels be null? it would be reasonable to actually return a multi-value here (e.g. same shape as the MI), but would need to see the implications if this is done.

i8 = self.asi8
try:

if len(i8) and self.is_monotonic:
Copy link
Contributor

Choose a reason for hiding this comment

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

prob can de-duplicate this with min

@jreback jreback added Clean Indexing Related to indexing on series/frames, not to indexes themselves labels Nov 23, 2020
@jreback jreback added this to the 1.2 milestone Nov 23, 2020
@jreback jreback merged commit fa0e405 into pandas-dev:master Nov 23, 2020
@jbrockmendel jbrockmendel deleted the cln-trys branch November 23, 2020 15:13
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants