Skip to content

Commit

Permalink
CLN: remove redundant LatexFormatter and tests (#52844)
Browse files Browse the repository at this point in the history
Co-authored-by: JHM Darbyshire (iMac) <attack68@users.noreply.github.com>
  • Loading branch information
attack68 and attack68 committed Apr 24, 2023
1 parent b548eab commit 78b7802
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 964 deletions.
32 changes: 0 additions & 32 deletions pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,38 +1022,6 @@ class DataFrameRenderer:
def __init__(self, fmt: DataFrameFormatter) -> None:
self.fmt = fmt

def to_latex(
self,
buf: FilePath | WriteBuffer[str] | None = None,
column_format: str | None = None,
longtable: bool = False,
encoding: str | None = None,
multicolumn: bool = False,
multicolumn_format: str | None = None,
multirow: bool = False,
caption: str | tuple[str, str] | None = None,
label: str | None = None,
position: str | None = None,
) -> str | None:
"""
Render a DataFrame to a LaTeX tabular/longtable environment output.
"""
from pandas.io.formats.latex import LatexFormatter

latex_formatter = LatexFormatter(
self.fmt,
longtable=longtable,
column_format=column_format,
multicolumn=multicolumn,
multicolumn_format=multicolumn_format,
multirow=multirow,
caption=caption,
label=label,
position=position,
)
string = latex_formatter.to_string()
return save_to_buffer(string, buf=buf, encoding=encoding)

def to_html(
self,
buf: FilePath | WriteBuffer[str] | None = None,
Expand Down

0 comments on commit 78b7802

Please sign in to comment.