Skip to content

Commit eaa9dba

Browse files
committed
whatsnew and changes requested
1 parent 76cda64 commit eaa9dba

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
@@ -1292,6 +1292,7 @@ Indexing
12921292
MultiIndex
12931293
^^^^^^^^^^
12941294

1295+
- Bug in :func:`io.formats.style.Styler.applymap` where ``subset=`` with :class:`MultiIndex` slice would reduce to :class:`Series` (:issue:`19861`)
12951296
- Bug in :func:`MultiIndex.__contains__` where non-tuple keys would return ``True`` even if they had been dropped (:issue:`19027`)
12961297
- 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`)
12971298
- 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
@@ -2733,11 +2733,10 @@ def _non_reducing_slice(slice_):
27332733
slice_ = IndexSlice[:, slice_]
27342734

27352735
def pred(part):
2736-
# true when slice does *not* reduce False when part is a tuple,
2736+
# true when slice does *not* reduce, False when part is a tuple,
27372737
# i.e. MultiIndex slice
2738-
if isinstance(part, tuple):
2739-
return False
2740-
return isinstance(part, slice) or is_list_like(part)
2738+
return (isinstance(part, slice) or is_list_like(part))\
2739+
and not isinstance(part, tuple)
27412740

27422741
if not is_list_like(slice_):
27432742
if not isinstance(slice_, slice):

0 commit comments

Comments
 (0)