Skip to content

BUG: IntervalIndex([np.nan, np.nan]).is_monotonic returns True #41831

Closed
@jbrockmendel

Description

@jbrockmendel

I'm pretty sure this is related to other questionable behavior:

index = pd.IntervalIndex([np.nan, np.nan])
other = pd.IntervalIndex([np.nan])

In [4]: index.is_monotonic  # should be False
Out[4]: True

In [5]: index._index_as_unique  # should be False
Out[5]: True

In [6]: index.get_indexer_for(other)  # shouldn't raise
InvalidIndexError: Reindexing only valid with uniquely valued Index objects

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexRelated to the Index class or subclassesIntervalInterval data type

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions