Skip to content

Commit e018666

Browse files
attack68feefladder
authored andcommitted
whats new 1.3.2 (pandas-dev#42839)
Co-authored-by: JHM Darbyshire (iMac) <[email protected]>
1 parent b12cda1 commit e018666

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

doc/source/whatsnew/v1.3.2.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Fixed regressions
3131
Bug fixes
3232
~~~~~~~~~
3333
- 1D slices over extension types turn into N-dimensional slices over ExtensionArrays (:issue:`42430`)
34-
-
34+
- :meth:`.Styler.hide_columns` now hides the index name header row as well as column headers (:issue:`42101`)
3535

3636
.. ---------------------------------------------------------------------------
3737

pandas/io/formats/style_render.py

+1
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ def _translate_header(
353353
self.data.index.names
354354
and com.any_not_none(*self.data.index.names)
355355
and not self.hide_index_
356+
and not self.hide_columns_
356357
):
357358
index_names = [
358359
_element(

pandas/tests/io/formats/style/test_style.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ def test_hide_column_headers(self):
11311131

11321132
self.df.index.name = "some_name"
11331133
ctx = self.df.style.hide_columns()._translate(True, True)
1134-
assert len(ctx["head"]) == 1 # only a single row for index names: no col heads
1134+
assert len(ctx["head"]) == 0 # no header for index names, changed in #42101
11351135

11361136
def test_hide_single_index(self):
11371137
# GH 14194

0 commit comments

Comments
 (0)