Skip to content

Commit 3d8275e

Browse files
committed
MAINT: Address reviewer comments
Closes pandas-devgh-14484 Closes pandas-devgh-17499
1 parent 7b0c554 commit 3d8275e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

doc/source/whatsnew/v0.21.1.txt

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ I/O
120120
- Bug in :meth:`DataFrame.to_msgpack` when serializing data of the numpy.bool_ datatype (:issue:`18390`)
121121
- Bug in :func:`read_json` not decoding when reading line deliminted JSON from S3 (:issue:`17200`)
122122
- Bug in :func:`pandas.io.json.json_normalize` to avoid modification of ``meta`` (:issue:`18610`)
123+
- Bug in :func:`to_latex` where repeated multi-index values were not printed even though a higher level index differed from the previous row (:issue:`14484`)
123124

124125
Plotting
125126
^^^^^^^^

pandas/tests/io/formats/test_to_latex.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,14 @@ def test_to_latex_multiindex(self):
221221

222222
assert result == expected
223223

224-
# GH 14484
224+
def test_to_latex_multiindex_dupe_level(self):
225+
# see gh-14484
226+
#
225227
# If an index is repeated in subsequent rows, it should be
226-
# replaced with a blank in the created table.
227-
# This should ONLY happen if all higher order indicies
228-
# (to the left) are equal, too.
229-
# In this test, 'c' has to be printed both times, because
230-
# the higher order index 'A' != 'B'
228+
# replaced with a blank in the created table. This should
229+
# ONLY happen if all higher order indices (to the left) are
230+
# equal too. In this test, 'c' has to be printed both times
231+
# because the higher order index 'A' != 'B'.
231232
df = pd.DataFrame(index=pd.MultiIndex.from_tuples(
232233
[('A', 'c'), ('B', 'c')]), columns=['col'])
233234
result = df.to_latex()
@@ -240,7 +241,6 @@ def test_to_latex_multiindex(self):
240241
\bottomrule
241242
\end{tabular}
242243
"""
243-
244244
assert result == expected
245245

246246
def test_to_latex_multicolumnrow(self):

0 commit comments

Comments
 (0)