bigframes.pandas.DataFrame.to_latex#
- DataFrame.to_latex(buf=None, columns: Sequence | None = None, header: bool | Sequence[str] = True, index: bool = True, *, allow_large_results: bool | None = None, **kwargs) str | None[source]#
Render object to a LaTeX tabular, longtable, or nested table.
Requires
\usepackage{{booktabs}}. The output can be copy/pasted into a main LaTeX document or read from an external file with\input{{table.tex}}.Examples:
>>> df = bpd.DataFrame({'col1': [1, 2], 'col2': [3, 4]}) >>> print(df.to_latex()) \begin{tabular}{lrr} \toprule & col1 & col2 \\ \midrule 0 & 1 & 3 \\ 1 & 2 & 4 \\ \bottomrule \end{tabular}
- Parameters:
buf (str, Path or StringIO-like, optional, default None) – Buffer to write to. If None, the output is returned as a string.
columns (list of label, optional) – The subset of columns to write. Writes all columns by default.
header (bool or list of str, default True) – Write out the column names. If a list of strings is given, it is assumed to be aliases for the column names.
index (bool, default True) – Write row names (index).
allow_large_results (bool, default None) – If not None, overrides the global setting to allow or disallow large query results over the default size limit of 10 GB.
- Returns:
If buf is None, returns the result as a string. Otherwise returns None.
- Return type:
str or None