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: Index.is_monotonic... incorrectly caching Index.is_unique when first value is NaT #55755

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

lukemanley
Copy link
Member

Fixes the following:

In [1]: import pandas as pd

In [2]: idx = pd.to_datetime([None, "2000-01-01", "2000-01-01"])

In [3]: idx.is_unique, idx.is_monotonic_increasing
Out[3]: (False, False)

In [4]: idx = pd.to_datetime([None, "2000-01-01", "2000-01-01"])

In [5]: idx.is_monotonic_increasing, idx.is_unique
Out[5]: (False, True)

@lukemanley lukemanley added Bug Index Related to the Index class or subclasses labels Oct 30, 2023
@lukemanley lukemanley added this to the 2.2 milestone Oct 30, 2023
@lukemanley lukemanley requested a review from WillAyd as a code owner October 30, 2023 00:51
@mroeschke mroeschke merged commit 327d559 into pandas-dev:main Oct 30, 2023
33 checks passed
@mroeschke
Copy link
Member

Thanks @lukemanley

@lukemanley lukemanley deleted the datelike-is-unique-with-nat branch November 16, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Index Related to the Index class or subclasses
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants