Skip to content

Commit 4ea8570

Browse files
committed
Revert slice(None) test
We need to order the slice(None) to comply with test from pandas/tests/indexing/multiindex/test_slice.py test_per_axis_per_level_doc_examples
1 parent 854b5f3 commit 4ea8570

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

pandas/core/indexes/multi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3045,7 +3045,7 @@ def _update_indexer(idxr, indexer=indexer):
30453045
elif com.is_null_slice(k):
30463046
# empty slice
30473047
# index is given to conserve the order of this level
3048-
indexer = _update_indexer(None, indexer=indexer)
3048+
indexer = _update_indexer(Int64Index(np.arange(n)), indexer=indexer)
30493049

30503050
elif isinstance(k, slice):
30513051

pandas/tests/indexes/multi/test_indexing.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,3 @@ def test_multiindex_loc_order():
555555
[["Colorado", "Ohio", "Ohio"], ["Green", "Red", "Green"]]
556556
)
557557
tm.assert_index_equal(res.columns, exp_columns)
558-
559-
res = df.loc[(slice(None), [2, 1]), :]
560-
exp_index = pd.MultiIndex.from_arrays([["a", "b", "a", "b"], [2, 2, 1, 1]])
561-
tm.assert_index_equal(res.index, exp_index)

0 commit comments

Comments
 (0)