Skip to content

Commit ac640db

Browse files
ivanovmgKevin D Smith
authored and
Kevin D Smith
committed
REF: simplify latex formatting (pandas-dev#35872)
1 parent 6f961e6 commit ac640db

File tree

3 files changed

+694
-193
lines changed

3 files changed

+694
-193
lines changed

pandas/io/formats/format.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -939,17 +939,18 @@ def to_latex(
939939
"""
940940
from pandas.io.formats.latex import LatexFormatter
941941

942-
return LatexFormatter(
942+
latex_formatter = LatexFormatter(
943943
self,
944-
column_format=column_format,
945944
longtable=longtable,
945+
column_format=column_format,
946946
multicolumn=multicolumn,
947947
multicolumn_format=multicolumn_format,
948948
multirow=multirow,
949949
caption=caption,
950950
label=label,
951951
position=position,
952-
).get_result(buf=buf, encoding=encoding)
952+
)
953+
return latex_formatter.get_result(buf=buf, encoding=encoding)
953954

954955
def _format_col(self, i: int) -> List[str]:
955956
frame = self.tr_frame

0 commit comments

Comments
 (0)