Skip to content

Commit 2370e0b

Browse files
committed
whatsnew and changes requested
1 parent 681c26a commit 2370e0b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/source/whatsnew/v0.23.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ Indexing
827827
MultiIndex
828828
^^^^^^^^^^
829829

830+
- Bug in :func:`io.formats.style.Styler.applymap` where ``subset=`` with :class:`MultiIndex` slice would reduce to :class:`Series` (:issue:`19861`)
830831
- Bug in :func:`MultiIndex.__contains__` where non-tuple keys would return ``True`` even if they had been dropped (:issue:`19027`)
831832
- Bug in :func:`MultiIndex.set_labels` which would cause casting (and potentially clipping) of the new labels if the ``level`` argument is not 0 or a list like [0, 1, ... ] (:issue:`19057`)
832833
- Bug in :func:`MultiIndex.get_level_values` which would return an invalid index on level of ints with missing values (:issue:`17924`)

pandas/core/indexing.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -2168,11 +2168,10 @@ def _non_reducing_slice(slice_):
21682168
slice_ = IndexSlice[:, slice_]
21692169

21702170
def pred(part):
2171-
# true when slice does *not* reduce False when part is a tuple,
2171+
# true when slice does *not* reduce, False when part is a tuple,
21722172
# i.e. MultiIndex slice
2173-
if isinstance(part, tuple):
2174-
return False
2175-
return isinstance(part, slice) or is_list_like(part)
2173+
return (isinstance(part, slice) or is_list_like(part))\
2174+
and not isinstance(part, tuple)
21762175

21772176
if not is_list_like(slice_):
21782177
if not isinstance(slice_, slice):

0 commit comments

Comments
 (0)