Skip to content

#51826_Fixed bug when np.nan is used as index value with .reindex on … #54500

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

Conversation

raj-thapa
Copy link
Contributor

@raj-thapa raj-thapa requested a review from WillAyd as a code owner August 11, 2023 14:37
@raj-thapa
Copy link
Contributor Author

In the query method, when nan was passed as index value, it triggered the else condition, which extended the result, without properly handling nan. This fix ensures proper handling of nan value right at the beginning of the query, preventing the unexpected behavior during reindexing.

@mroeschke mroeschke added Interval Interval data type Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Aug 11, 2023
)
def test_interval_index_reindex_behavior(self, base, expected_result):
# GH 51826
left = np.arange(base, dtype=np.int32)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the dtypes from both of these

@raj-thapa raj-thapa closed this Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interval Interval data type Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: unexpected value returned when .reindexing on a pd.Series with a pd.IntervalIndex when using np.nan as an index value
3 participants