File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -3312,21 +3312,19 @@ def equals(self, other: object) -> bool:
3312
3312
if not isinstance (other , Index ):
3313
3313
return False
3314
3314
3315
+ if len (self ) != len (other ):
3316
+ return False
3317
+
3315
3318
if not isinstance (other , MultiIndex ):
3316
3319
# d-level MultiIndex can equal d-tuple Index
3317
3320
if not is_object_dtype (other .dtype ):
3318
3321
# other cannot contain tuples, so cannot match self
3319
3322
return False
3320
- elif len (self ) != len (other ):
3321
- return False
3322
3323
return array_equivalent (self ._values , other ._values )
3323
3324
3324
3325
if self .nlevels != other .nlevels :
3325
3326
return False
3326
3327
3327
- if len (self ) != len (other ):
3328
- return False
3329
-
3330
3328
for i in range (self .nlevels ):
3331
3329
self_codes = self .codes [i ]
3332
3330
self_codes = self_codes [self_codes != - 1 ]
You can’t perform that action at this time.
0 commit comments