Skip to content

Tst interval index NaN uniqueness #41870

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

Merged
10 changes: 10 additions & 0 deletions pandas/tests/indexes/interval/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,16 @@ def test_is_unique_interval(self, closed):
idx = IntervalIndex.from_tuples([(-1, 1), (-2, 2)], closed=closed)
assert idx.is_unique is True

# unique NaN
idx = IntervalIndex.from_tuples([(np.NaN, np.NaN)], closed=closed)
assert idx.is_unique is True

# non-unique NaN
idx = IntervalIndex.from_tuples(
[(np.NaN, np.NaN), (np.NaN, np.NaN)], closed=closed
)
assert idx.is_unique is False

def test_monotonic(self, closed):
# increasing non-overlapping
idx = IntervalIndex.from_tuples([(0, 1), (2, 3), (4, 5)], closed=closed)
Expand Down