Skip to content
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

BUG: MultiIndex.is_montonic erronoes when nan in at least one level #37220

Closed
3 tasks done
phofl opened this issue Oct 18, 2020 · 0 comments · Fixed by #37221
Closed
3 tasks done

BUG: MultiIndex.is_montonic erronoes when nan in at least one level #37220

phofl opened this issue Oct 18, 2020 · 0 comments · Fixed by #37221
Assignees
Labels
MultiIndex Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@phofl
Copy link
Member

phofl commented Oct 18, 2020

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

print(pd.MultiIndex.from_tuples([(np.nan, ), (1,)], names=["test"]).is_monotonic_increasing)

Problem description

This returns True, which is obviously not correct. This was introduced by #27495. The error persists with more than one level in the MultiIndex. The example is just for simplicity.

Expected Output

False

Output of pd.show_versions()

master

@phofl phofl added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 18, 2020
@phofl phofl changed the title BUG: MultiIndex cont BUG: MultiIndex.is_montonic erronoes when nan in at least one level Oct 18, 2020
@phofl phofl added MultiIndex Regression Functionality that used to work in a prior pandas version and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 18, 2020
@phofl phofl added this to the 1.1.4 milestone Oct 18, 2020
@phofl phofl self-assigned this Oct 18, 2020
ueshin pushed a commit to databricks/koalas that referenced this issue Nov 11, 2020
Since pandas 1.1.4 has been released, upgraded pandas version in CI.

From pandas 1.1.4, `MultiIndex.monotonic_increasing` and `MultiIndex.monotonic_decreasing` return `False` if the `MultiIndex` includes null value - before pandas 1.1.4, they treat the null value as the smallest value -.
Refer to pandas-dev/pandas#37220 for more detail.

Therefore, several behavior is fixed, and added more related tests.

[What’s new in pandas 1.1.4](https://pandas.pydata.org/docs/whatsnew/v1.1.4.html)
rising-star92 added a commit to rising-star92/databricks-koalas that referenced this issue Jan 27, 2023
Since pandas 1.1.4 has been released, upgraded pandas version in CI.

From pandas 1.1.4, `MultiIndex.monotonic_increasing` and `MultiIndex.monotonic_decreasing` return `False` if the `MultiIndex` includes null value - before pandas 1.1.4, they treat the null value as the smallest value -.
Refer to pandas-dev/pandas#37220 for more detail.

Therefore, several behavior is fixed, and added more related tests.

[What’s new in pandas 1.1.4](https://pandas.pydata.org/docs/whatsnew/v1.1.4.html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MultiIndex Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant