File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -591,7 +591,11 @@ def test_equals_categorical(self):
591
591
# make sure that we are testing for category inclusion properly
592
592
ci = CategoricalIndex (list ('aabca' ), categories = ['c' , 'a' , 'b' ])
593
593
assert not ci .equals (list ('aabca' ))
594
- assert not ci .equals (CategoricalIndex (list ('aabca' )))
594
+ # Same categories, but different order
595
+ # Unordered
596
+ assert ci .equals (CategoricalIndex (list ('aabca' )))
597
+ # Ordered
598
+ assert not ci .equals (CategoricalIndex (list ('aabca' ), ordered = True ))
595
599
assert ci .equals (ci .copy ())
596
600
597
601
ci = CategoricalIndex (list ('aabca' ) + [np .nan ],
@@ -603,7 +607,9 @@ def test_equals_categorical(self):
603
607
ci = CategoricalIndex (list ('aabca' ) + [np .nan ],
604
608
categories = ['c' , 'a' , 'b' ])
605
609
assert not ci .equals (list ('aabca' ) + [np .nan ])
606
- assert not ci .equals (CategoricalIndex (list ('aabca' ) + [np .nan ]))
610
+ assert ci .equals (CategoricalIndex (list ('aabca' ) + [np .nan ]))
611
+ assert not ci .equals (CategoricalIndex (list ('aabca' ) + [np .nan ],
612
+ ordered = True ))
607
613
assert ci .equals (ci .copy ())
608
614
609
615
def test_string_categorical_index_repr (self ):
You can’t perform that action at this time.
0 commit comments