Skip to content

Conversation

@phofl
Copy link
Member

@phofl phofl commented Jun 13, 2022

@phofl phofl added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Regression Functionality that used to work in a prior pandas version Index Related to the Index class or subclasses labels Jun 13, 2022
@phofl phofl added this to the 1.4.3 milestone Jun 13, 2022
arr[self.isna()] = False
return arr
elif op in {operator.ne, operator.lt, operator.gt}:
elif op == operator.ne:
Copy link
Member

Choose a reason for hiding this comment

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

is?

Copy link
Member Author

Choose a reason for hiding this comment

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

Was not sure about it, but it does get hit through !=

Copy link
Member

Choose a reason for hiding this comment

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

quickly scanning the code, it appears we mostly use is elsewhere

Copy link
Member Author

Choose a reason for hiding this comment

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

Thx, will change

Copy link
Member Author

Choose a reason for hiding this comment

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

done

assert attrs == {"name": None}


def test_nan_comparison_same_object():
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 test gt as well as lt; this doesn't affect le, ge right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done and no, they are checked i a different if block

Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

thanks @phofl lgtm.

@jreback jreback merged commit 7310d90 into pandas-dev:main Jun 15, 2022
@jreback
Copy link
Contributor

jreback commented Jun 15, 2022

thanks @phofl

@jreback
Copy link
Contributor

jreback commented Jun 15, 2022

@meeseeksdev backport 1.4.x

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Jun 15, 2022
@lumberbot-app
Copy link

lumberbot-app bot commented Jun 15, 2022

Could not push to auto-backport-of-pr-47326-on-1.4.x due to error, aborting.

@phofl phofl deleted the 47105 branch June 15, 2022 11:43
simonjayhawkins pushed a commit that referenced this pull request Jun 15, 2022
… Index object) (#47364)

Backport PR #47326: REGR: Fix nan comparison for same Index object

Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Index Related to the Index class or subclasses Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Regression Functionality that used to work in a prior pandas version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: nan comparisons behave differently on identical objects

3 participants