Skip to content

Commit c625610

Browse files
committed
doc change
1 parent cd05038 commit c625610

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

pandas/core/generic.py

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,14 +3500,17 @@ def _to_latex_via_styler(
35003500
):
35013501
"""
35023502
Render object to a LaTeX tabular, longtable, or nested table.
3503+
35033504
Uses the ``Styler`` implementation with the following, ordered, method chaining:
3505+
35043506
.. code-block:: python
35053507
styler = Styler(DataFrame)
35063508
styler.hide(**hide)
35073509
styler.relabel_index(**relabel_index)
35083510
styler.format(**format)
35093511
styler.format_index(**format_index)
35103512
styler.to_latex(buf=buf, **render_kwargs)
3513+
35113514
Parameters
35123515
----------
35133516
buf : str, Path or StringIO-like, optional, default None
@@ -3526,35 +3529,11 @@ def _to_latex_via_styler(
35263529
list will call the method numerous times.
35273530
render_kwargs : dict
35283531
Keyword args to pass to the method call of ``Styler.to_latex``.
3532+
35293533
Returns
35303534
-------
35313535
str or None
35323536
If buf is None, returns the result as a string. Otherwise returns None.
3533-
See Also
3534-
--------
3535-
Styler.to_latex : Render a DataFrame to LaTeX with conditional formatting.
3536-
DataFrame.to_string : Render a DataFrame to a console-friendly
3537-
tabular output.
3538-
DataFrame.to_html : Render a DataFrame as an HTML table.
3539-
Examples
3540-
--------
3541-
Convert a general DataFrame to LaTeX with formatting:
3542-
>>> df = pd.DataFrame(dict(name=['Raphael', 'Donatello'],
3543-
... age=[26, 45],
3544-
... height=[181.23, 177.65]))
3545-
>>> print(df.to_latex(hide={"axis": "index"},
3546-
... format={"formatter": {"name": str.upper},
3547-
... "precision": 1},
3548-
... render_kwargs={"hrules": True}
3549-
... ) # doctest: +SKIP
3550-
\begin{{tabular}}{{lrr}}
3551-
\toprule
3552-
name & age & height \\
3553-
\\midrule
3554-
RAPHAEL & 26 & 181.2 \\
3555-
DONATELLO & 45 & 177.7 \\
3556-
\bottomrule
3557-
\\end{{tabular}}
35583537
"""
35593538
from pandas.io.formats.style import Styler
35603539

0 commit comments

Comments
 (0)