File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1403,7 +1403,7 @@ def is_monotonic_increasing(self) -> bool:
1403
1403
return if the index is monotonic increasing (only equal or
1404
1404
increasing) values.
1405
1405
"""
1406
- if all (x . is_monotonic for x in self .levels ):
1406
+ if all (self . get_level_values ( i ). is_monotonic for i in range ( self .nlevels ) ):
1407
1407
# If each level is sorted, we can operate on the codes directly. GH27495
1408
1408
return libalgos .is_lexsorted (
1409
1409
[x .astype ("int64" , copy = False ) for x in self .codes ]
@@ -1649,8 +1649,7 @@ def _lexsort_depth(self) -> int:
1649
1649
int64_codes = [ensure_int64 (level_codes ) for level_codes in self .codes ]
1650
1650
else :
1651
1651
int64_codes = [
1652
- ensure_int64 (algos .factorize (self .get_level_values (i ), sort = True )[0 ])
1653
- for i in range (self .nlevels )
1652
+ ensure_int64 (algos .factorize (i , sort = True )[0 ]) for i in self .levels
1654
1653
]
1655
1654
for k in range (self .nlevels , 0 , - 1 ):
1656
1655
if libalgos .is_lexsorted (int64_codes [:k ]):
Original file line number Diff line number Diff line change @@ -2015,7 +2015,8 @@ def test_dup_labels_output_shape(groupby_func, idx):
2015
2015
tm .assert_index_equal (result .columns , idx )
2016
2016
2017
2017
2018
- def test_multiindex_lexsorted ():
2018
+ def test_sort_false_multiindex_lexsorted ():
2019
+ # GH 32259
2019
2020
d = pd .to_datetime (
2020
2021
[
2021
2022
"2020-11-02" ,
You can’t perform that action at this time.
0 commit comments