pandas.io.formats.style.Styler.to_latex

pandas 3.1.1 · Input and output · method

Produce a LaTeX table representation of the receiver.

Call syntax

Styler.to_latex(…) Full signature
Styler.to_latex(
    buf=None,
    *,
    column_format=None,
    position=None,
    position_float=None,
    hrules=None,
    clines=None,
    label=None,
    caption=None,
    sparse_index=None,
    sparse_columns=None,
    multirow_align=None,
    multicol_align=None,
    siunitx=False,
    environment=None,
    encoding=None,
    convert_css=False,
)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
buf Optional
Positional or keyword
Default None
str, path object, file-like object, or None

Supply a destination file-like buffer, or use the default to return or print the output as documented.

column_format Optional
Keyword only
Default None
str
position Optional
Keyword only
Default None
str
position_float Optional
Keyword only
Default None
{"centering", "raggedleft", "raggedright"}
hrules Optional
Keyword only
Default None
bool
clines Optional
Keyword only
Default None
str
label Optional
Keyword only
Default None
str

Provide the label used to identify an entry or mark a result.

caption Optional
Keyword only
Default None
str, tuple

Provide the title or caption used in rendered output.

sparse_index Optional
Keyword only
Default None
bool
sparse_columns Optional
Keyword only
Default None
bool
multirow_align Optional
Keyword only
Default None
{"c", "t", "b", "naive"}
multicol_align Optional
Keyword only
Default None
{"r", "c", "l", "naive-l", "naive-r"}
siunitx Optional
Keyword only
Default False
bool
environment Optional
Keyword only
Default None
str
encoding Optional
Keyword only
Default None
str

Name a text encoding such as "utf-8".

convert_css Optional
Keyword only
Default False
bool

Returns

str or None