-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
BugIndexRelated to the Index class or subclassesRelated to the Index class or subclassesNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further actionTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suite
Description
Ref: #53049 (comment)
The following does not raise:
index1 = pd.MultiIndex(levels=[['a', 'b']], codes=[[0, 1]])
index2 = pd.MultiIndex(levels=[['b', 'a']], codes=[[1, 0]])
tm.assert_index_equal(index1, index2)
In some sense, these indices are equal. However, levels
is sometimes used as an order in certain ops, and if this is not consistently set then inconsistencies can arise. See #53009 for an example.
It seems to me that because of this, we should not consider these indices equal.
Metadata
Metadata
Assignees
Labels
BugIndexRelated to the Index class or subclassesRelated to the Index class or subclassesNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further actionTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suite